MongoDB - How to organize collections -


just general question here - i'm doing self paced learning on mongodb , off on right foot i'd opinion on how organize collections sample budget application.

as home budget have 'categories' such home, auto , have subcategories under categories such mortgage , car payments.

each bill have due date, minimum amount due, forecast payment, forecast payment date, actual payment , actual payment date.

each bill due 'someone', example home, mortgage may due bank of america, , bank of america may have contact info (phone, mailing address).

making switch table structure mongo bit confusing, appreciate opinions on how approach this.

the question general. in general :), following principles apply schema design in mongodb:

  • the layout of collections should guided sound modeling principles. mongodb, can have schema more closely resembles object structure of data, opposed relational "projection" of it.

  • the layout of collections should guided data access patterns (which may conflict previous statement). design schemas can info need in few queries possible, without loading data don't need application.

  • you can, , should, "denormalize" achieve above two. it's not bad thing mongodb @ all. downside of denormalizing updates become more expensive , need make sure maintain consistency. downsides outweighed more natural modeling , better read efficiency.

from description above, sounds if have rather "relational" model in mind. try rid of , approach problem fresh mind. think objects, not tables.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -