Skip to main content

Posts

Showing posts with the label nosql

MongoDB schema design

  Schema Design There is an ideal way to design databases in relational databases — 3rd normal form. In MongoDB , it’s important to keep data in way that’s conducive to the application using the data . You think about application data patterns what pieces of data are used together what pieces of data are used mostly read-only what pieces of data are written all the time In contrast, in relational DBMS — the data is organized in such a way that is agnostic to the application. MongoDB supports rich documents . We can store an array of items, a value for a certain key can be an entire other document. This is going to allow us to pre-join/embed data for fast access. And that’s important because MongoDB doesn’t support joins directly inside the kernel. Instead if we need to join, we need to join in the application itself. The reason being joins are very hard to scale . This forces us to think ahead of time about what data you want to use together with other data . We might wish to e...