Database Models – Part 2

You can find the Part 1 of article on Database Model here

Key-Value Database Model

Key value database is a data storage paradigm where data is stored, retrieved and managed in associative arrays. These are now commonly known as Dictionary or Hash Table. As the name suggest it consists of Key and Value pairs. Here keys are unique and values can contain data of various lengths and types. He user can access the value using the key. There are no predefined schema for the values so it may contain different field for every record.

Key Value Model

Advantages of Key Value Model

  • Faster read and write operations due to simple data format
  • Value can be anything including JSON

Disadvantages of Key Value Database Model

  • Optimized only for data with single key and value.
  • Not optimized for lookup

Column-Based Database Model

In a column based database  data is stored in columns rather than in rows. This type of databases are mainly used in large data warehouses. The reason for this is that when doing analytical operations accessing only the required columns is much faster than accessing each column and then extracting few columns you need.

Column-Based Database Model

Advantages of Column Based Database Model

  • Compression
    • Highly efficient data compression
  • Aggregation queries
    • As the column based databases can query directly to columns they perform well in queries such as calculating sum, calculating average etc.
  • Scalability
    • Column databases are highly scalable
  • Fast to load and query
    • These databases can be loaded extremely fast.

Disadvantages of Column Based Database Model

  • High Insertion Time
  • High update time
  • Low performance for queries with JOINS

Document Database Model

Document oriented database model is designed for storing, retrieving and managing document oriented semi structured information. This can be described as a subclass of key value database model. Difference is that in Key Value database model data in the value is inherently opaque to the system but in document database model, system relies on meta data in the value to further optimizations. Generally the data is encoded using standard encoding techniques such as XML, YAML, JSON etc.

There is no fixed schema for the structure of the document. So it is easy to insert new field later.

Document Database Model

Advantages of Document oriented database model

  • Documents are independent
  • Objects can be directly written as documents
  • Can easily store unstructured data
  • Have strong indexing feature

Graph Database Model

In graph database model graph structures such as nodes and edges are used to represent and store data. Graph data model can be referred as being “whiteboard-friendly”. Which means we can directly  build the database using arbitrary data and their connections without formatting and structuring to fit a normalized model.

Graph Database Model

Advantages of Graph data model

  • Object oriented thinking
  • Very high performance for querying related data.
  • Can solve problems which are impractical for relational query.
  • Can do real time updates on big data simultaneously querying the data.
  • Flexible
  • Can do group by aggregate queries which are not possible in relational databases.
  • Can combine multiple dimensions to manage big data.

Disadvantages of Graph Data Model

  • If there is no connections, there will be no significant effect
  • Less number of experts
  • No standard.

References

Kavinda

Proud UCSCian | Proud Devan | Computer Geek | Superman | Love Chess & Programming

One thought on “Database Models – Part 2

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: