When should I use a NoSQL database instead of a relational database? Is it okay to use both on the same site?

前端 未结 8 971
刺人心
刺人心 2020-12-07 07:56

What are the advantages of using NoSQL databases? I\'ve read a lot about them lately, but I\'m still unsure why I would want to implement one, and under what circumstances I

8条回答
  •  佛祖请我去吃肉
    2020-12-07 08:34

    I designed and implemented solutions with NoSQL databases and here is my checkpoint list to make the decision to go with SQL or document-oriented NoSQL.

    DON'Ts

    SQL is not obsolete and remains a better tool in some cases. It's hard to justify use of a document-oriented NoSQL when

    • Need OLAP/OLTP
    • It's a small project / simple DB structure
    • Need ad hoc queries
    • Can't avoid immediate consistency
    • Unclear requirements
    • Lack of experienced developers

    DOs

    If you don't have those conditions or can mitigate them, then here are 2 reasons where you may benefit from NoSQL:

    • Need to run at scale
    • Convenience of development (better integration with your tech stack, no need in ORM, etc.)

    More info

    In my blog posts I explain the reasons in more details:

    • 7 reasons NOT to NoSQL
    • 2 reasons to NoSQL

    Note: the above is applicable to document-oriented NoSQL only. There are other types of NoSQL, which require other considerations.

提交回复
热议问题