Page 1 of 1

Database design best practice

Posted: Fri Jul 18, 2014 12:41 pm
by Todd6808807

Hi,

Im about to do the Camera Component tutorial & had a question around database design.

I have a need to store multiple photos per database record that also has some other fields.

So my question is should I create a separate db or even collection or simply add some fields into my existing collection?

Thanks in advance


Database design best practice

Posted: Fri Jul 18, 2014 1:25 pm
by Evgene Karachevtsev

Hello Todd,

You shouldn't create new database. Please tell us how do you keep the picture - as a file and in the collection you store the name of a file or in collection you keep base64encoded string with the content of the file?


Database design best practice

Posted: Sat Jul 19, 2014 7:05 am
by Todd6808807

Thanks for responding Evgene,

What would be best practice? Im happy to do whatever is best.


Database design best practice

Posted: Sat Jul 19, 2014 7:16 am
by Todd6808807

just a reminder that there may be up to 5 photos that relate to the record. For example a record in the collection might relate to an event. That event might have fields date, location & comments. Attached to that event can be up to the 5 photos.

Thanks


Database design best practice

Posted: Mon Jul 21, 2014 7:26 am
by Kateryna Grynko

Hi Todd,

This depends on app logic. For example, you could store images in Database Files and store images names in a field of array type.


Database design best practice

Posted: Thu Jul 24, 2014 3:16 am
by Todd6808807

Thanks for your response I'm not sure what is the best way to go (even based on your above answer)


Database design best practice

Posted: Thu Jul 24, 2014 3:29 am
by Alena Prykhodko

Both are applicable.