mongoose - Justifying the use of MongoDB -


i'm new full stack development , need justifying use of mongodb web app. use mongoose , schema-based solution model application data.

i built simple web app (website) shows art projects gallery. during development discovering needed additional fields in schemas. because mongodb flexible , allows dynamic modification of schema came helpful.

another thing find appealing monogdb uses javascript object notation (json) readable humans , machines.

because i'm not familiar relational database management system , relational databases, don't state benefits of using mongodb in comparison others.

please help.

if have application requires transactions (atomic batch operations or nothing), , don't want scale database across multiple instances don't use mongodb use sql database system.

mongodb used database data doesn't respect schema, while sql database systems require schema, , gives layer validate data before saving database.

when working documents (mongodb row's versions), there tricks when comes applying associations other documents, usally doesn't follow normalization rules, , depends of need when read document. if document collection has relationship document collection b, can either add reference id (foreign key), entire document, or foreign key plus fields want, avoid reading document.

mongodb has aggregation framework, bultin feature, make computing operations on huge set of data, stored in different nodes resides on different hosts. when have data, , want scale on sql database, have store data on single host, or same network, , thuse have scale vertically; mongodb can have many commodity hardware scale on data.

speaking of mongodb architecture, gives huge scalabilty, mongodb provides sharding system, gives possibility slice database different shards each shards follow kind of rule. , high availability, instant recovery replica set system, whenever primary node falls can write, secondary nodes (that reads) elects 1 node take place.

the important thing remember kind of data going save. if data doesn't have stable schema, , have transactions (vital one), don't use mongodb.

don't forget can use both of databases systems, each need.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -