What are the advantages of using a schema-free database like MongoDB compared to a relational database?

前端 未结 9 1813
别那么骄傲
别那么骄傲 2020-12-22 16:02

I\'m used to using relational databases like MySQL or PostgreSQL, and combined with MVC frameworks such as Symfony, RoR or Django, and I think it works great.

But la

9条回答
  •  一生所求
    2020-12-22 16:39

    Here are some of the advantages of MongoDB for building web applications:

    1. A document-based data model. The basic unit of storage is analogous to JSON, Python dictionaries, Ruby hashes, etc. This is a rich data structure capable of holding arrays and other documents. This means you can often represent in a single entity a construct that would require several tables to properly represent in a relational db. This is especially useful if your data is immutable.
    2. Deep query-ability. MongoDB supports dynamic queries on documents using a document-based query language that's nearly as powerful as SQL.
    3. No schema migrations. Since MongoDB is schema-free, your code defines your schema.
    4. A clear path to horizontal scalability.

    You'll need to read more about it and play with it to get a better idea. Here's an online demo:

    http://try.mongodb.org/

提交回复
热议问题