So… this NoSQL thing

后端 未结 8 1941
醉酒成梦
醉酒成梦 2021-01-30 12:43

I\'ve been looking at MongoDB and I\'m fascinated. It appears (although I have to be suspicious) that in exchange for organizing my database in a slightly different way, I get a

8条回答
  •  囚心锁ツ
    2021-01-30 13:35

    Remember, NoSQL isn't exactly new. After all, they had to use something before SQL and relational databases, right? In fact, systems like MUMPS and CODASYL work the same way and are decades old. What relational databases give you is the ability to query data in arbitrary ways.

    Say you have a database with customers, their purchases, and what items they purchased. A NoSQL DB might have customers containing purchases and purchases containing items. This makes it easy to find out what items a given customer purchased, but hard to find out what customers purchased a given item. A relational DB would have tables for customers, purchases, items, and a table linking items to purchases. In SQL, both queries are trivial to formulate, and the database engine does all the hard work for you.

    Also, keep in mind that part of the NoSQL trend is to sacrifice consistency or reliability for speed, scalability, and cost. Relational DBs can scale, but it's not cheap. If you go to http://tpc.org you can find RDBMSes that run on hundreds of cores simultaneously to deliver millions of transactions per minute, but they cost millions of dollars.

提交回复
热议问题