How to convert an existing relational database to a key-value store?

后端 未结 2 1399
情话喂你
情话喂你 2021-01-19 21:33

I am trying to map a existing relational database to a key value store. Couple of example tables are represented below.

For an instance the above \"Employee

相关标签:
2条回答
  • 2021-01-19 21:49

    Relational tables represent business/application relationships/associations. FKs (foreign keys) get called relationships but aren't. (They're just truths about every business/application situation & corresponding database state.) A FK constraint declaration just tells the RDBMS to enforce that subrows appear elsewhere as a superkey (unique key). (Although the DBMS can use it to optimize.) Constraints are not needed to query relationally.

    FKs are relational. In a non-relational DBMS if you want to make certain queries simpler or faster, eg when they are the equivalents of certain relational joins involving certain FKs, at the expense of complicating updates & other queries, then you do things like record data redundantly, or in a nested/hierarchical way, or using pointers/indirection.

    This difference in relational vs non-relational schemas & querying is fundamental to the difference in data models & to the benefits of the relational model. Using relational tables as data structure allows straightforward application-neutral querying with with certain implementation computational complexity & optimization opportunities. Any intro to a particular NoSQL DBMS will explain how to model & query. (Typically assuming an initial relational design.)

    0 讨论(0)
  • 2021-01-19 22:04

    Nosql databases are basically aggregate stores. Relationships and its associated values are stored in a 'value' part of key - val design.

    Avoiding joins helps in better performance.

    Excellent llink on nosql modeling - https://highlyscalable.wordpress.com/2012/03/01/nosql-data-modeling-techniques/

    0 讨论(0)
提交回复
热议问题