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

前端 未结 8 976
刺人心
刺人心 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:41

    NoSQL is database system where data is organised into the document (MongoDB), key-value pair (MemCache, Redis), graph structure form(Neo4J).

    Maybe here are possible questions and answer for "When to go for NoSQL":

    1. Require flexible schema or deal with tree like data?
      Generally, in agile development we start designing system without knowing all requirement in upfront, where later on throughout development database system may need accommodate frequent design changes, showcasing MVP (Minimal Viable product). Or you are dealing with data schema which is dynamic in nature. e.g. System logs, very precise example is AWS cloudwatch logs.

    2. Data set is vast/big?
      Yes NoSQL database are the better candidate for applications where database needs to manage million or even billions of records without compromising over performance.

    3. Trade off between scaling over consistency
      Unlike RDMS, NoSQL database may lose small data here and there(Note: probability is .x%), but its easy to scale in terms of performance. Example: This may good for storing people who are online in instant messaging app, tokens in db, logging web site traffic stats.

    4. Performing Geolocation Operations: MongoDB hash rich support for doing GeoQuerying & Geolocation operations. I really loved this feature of MongoDB.

    In nutshell, MongoDB is great fit for applications where you can store dynamic structured data at large scale.

提交回复
热议问题