Featured Post

Event Sourcing Video from Michael Ploed

Event Sourcing I want to share a great video I found few days ago that describes very well what Event Sourcing is.

Monday, February 12, 2018

NoSQL Datamodel

Key Value

A Key Value store is similar to a document based store, except for the fact that is more like an hash table where the key is unique and the value is not necessarily a JSON structure. Furthermore the Key Value store accepts different types from value to value.
General use cases are:
  • Session management
  • Profile management
Key Value store are precious when dealing with different data that can be identified by a unique key.
Example of key-value store:
  • Redis
  • Riak
  • RocksDB

Document Oriented

A Document Oriented stores can be considered an extension of a key-value store, where the key can be specified or provided by the database. Document Oriented database uses generally value types: XML, JSON, BSON. Documents offer a richer capability to index or search, and they overcome limitations building nested document compared to columnar databases.
Document database are well when:
  • Managing list of variable attributes, such as products
  • Tracking variable types of metadata

Example of document oriented store:
  • MongoDB

Column Oriented

A column-oriented database stores each column continuously. In this way columns with the same value are neighbour and values can be compressed.
Column database are well when:
  • Read operations affects many rows with few columns
  • Compression is needed

General use cases are:
  • Event logging
  • Analitycs
Example of column based store:
  • Apache HBase

Graph Based

Graph database are well when:
  • Very connected data

Relational Database uses foreign key to build references between tables and when a query requires to navigate a relationship, join operations are used at runtime with increasing cost and time.
Graph Databases use the concept of node that directly contains a list of relationships-records towards to other nodes. Every time in a RDBMS a join has to be used, in a Graph DB the direct access to its connected nodes eliminates the need for expensive searches and match computations.
Actually JOIN tables are transformed into data relationships.

References

  • https://www.mongodb.com/scale/nosql-database-comparison
  • https://blog.pandorafms.org/nosql-databases-the-definitive-guide/

No comments :

Post a Comment