top

Search

AWS Tutorials

NoSQL databases are built to work with specific data models. They have flexible schemas which are built to work with modern applications. This type of database is widely used since it is easy to develop applications using NoSQL and provides scalability. They can be used with a wide variety of data models which can be used to access and manage data. Such models include documents, graph, key-value, in-memory, and search.  NoSQL databases are optimized specifically to work with applications which require large volumes of data, low latency, and flexible data models. These features can be achieved by modifying some of the data consistency restrictions which are usually very strictly applied on other databases.  Let us look at the comparison of building a relational and a non-relational database.In a relational database, records are usually normalized and stored in separate tables. Relationships are defined with the help of primary and foreign key constraints. A relational database model is designed so as to enable the model to enforce referential integrity between the records stored in the database. The tables are normalized so as to reduce redundancy and provide optimal storage techniques.  In contrast, in a NoSQL database, a record is usually stored in JSON format. Every column name is stored as an attribute within a single document. Such a model makes sure that data is optimized for horizontal scalability, and is used for flexible and intuitive development. NoSQL databases are a great choice to work with modern applications such as mobile, web, and gaming, since these fields require flexible, scalable, high-performing, and highly functional databases since they help in provisioning exceptional user experience.  Features of NoSQL databasesThey provide flexible schemas so that the development is quick and iterative. This kind of flexibility in NoSQL models makes it ideal to be used with semi-structured and unstructured data.  NoSQL databases are designed to be scaled out with the help of distributed clusters of hardware instead of adding robust and expensive servers.  There is a facility provided by certain cloud providers to handle this scaling out of NoSQL databases behind-the-scenes as a fully managed service.  It is optimized to handle specific data models and access patterns so as to provide higher performance, instead of trying to accomplish similar functionalities with relational databases.  They provide highly functional APIs and data types which are custom built to work with respective data models.  NoSQL database makes trade-offs by modifying the ACID properties which is essential and strict in relational databases, thereby providing a much more flexible data model, which has the ability to be scaled horizontally. This is the reason behind using NoSQL wherein high throughput, and low latency are major concerns.  Performance depends on the underlying hardware cluster size and network latency. It changes based on these factors.  NoSQL databases can be partitioned easily since key-value pattern can be a convenient choice to scale out the application with the help of a distributed architecture. Such an architecture helps in increasing the throughput of the application thereby improving the performance consistency.  NoSQL can be used to provide object-based APIs thereby allowing application developers to store and retrieve data from in-memory data structures easily. Partition keys allow the applications to look-up for data based on key-value pairs, column sets or semi-structured documents that store serialized application objects and attributes.  The different types of NoSQL databases are designed to work with OLTPs(online transaction processing) for multiple data access patters. This includes applications which have low latency.  Types of NoSQL database There are different types of NoSQL databases. They have been discussed below: Key-ValueThis type of database can be partitioned and can be scaled horizontally. This is a highlight in the key-value database, which can’t be achieved with other databases. This type of database is used in gaming, ad-tech, and IoT industries. Amazon DynamoDB has been designed to provision consistent single-digit millisecond latency irrespective of the scale of the workloads. This performance plays an important role, and an example is Snapchat Stories feature, which works with DynamoDB.  DocumentIn application code, data is represented as object or a JSON document since it is an efficient way to model data. Document database helps in storing and querying data in a database in the same format that is used in their application code. This type of flexible, semi-structured, and hierarchical nature of document databases help in modifying them easily based on the requirements which are modified on-the-go. They work very well with catalogs, user-profiles, and content management systems wherein every document is unique and changes overtime. Examples of document database include MongoDB and Amazon DocumentDB.GraphThe intuition behind a graph database is to make it easy to build and run applications which work with high connectivity datasets. Use cases of graph databases include (but are not limited to) social networking sites, recommendation engines, fraud detection, and knowledge graphs. One such example is Amazon Neptune, which provides a fully-managed graph database service. It comes with support for Property Graph model and Resource Description framework (RDF) thereby providing two choices for graph APIs- TinkerPop and RDF/SPARQL.  In-MemoryThis type of database is used with applications that work with real-time data which require microsecond response times, and there could be significant spikes in the incoming traffic at any point in time. Some applications which use in-memory databases are gaming and ad-tech apps which need leader boards, session stores, and real time analytics. Amazon ElastiCache provides Memcached and Redis, which help provide low latency, and high throughput workloads. Another example is the Amazon DynamoDB Accelerator (DAX) which is a custom build data storage system. DAX helps in improving the DynamoDB reads.  SearchOutput logs helps developers in troubleshooting certain issues. One such example is Amazon Elastic Search Service which is customized to provide near-real-time visualizations and analytics of data which has been generated by machine with the help of indexing, aggregating and searching large number of semi-structure logs and metrics. ES is a powerful search engine that can be used for full text search use case.  Conclusion  In this post, we understood how non-relational databases are different in comparison to relational databases.Non-relational databases and Relational database
logo

AWS Tutorials

Non-relational databases vs Relational database - What's the differences?

NoSQL databases are built to work with specific data models. They have flexible schemas which are built to work with modern applications. This type of database is widely used since it is easy to develop applications using NoSQL and provides scalability. They can be used with a wide variety of data models which can be used to access and manage data. Such models include documents, graph, key-value, in-memory, and search.  

NoSQL databases are optimized specifically to work with applications which require large volumes of data, low latency, and flexible data models. These features can be achieved by modifying some of the data consistency restrictions which are usually very strictly applied on other databases.  

Let us look at the comparison of building a relational and a non-relational database.

In a relational database, records are usually normalized and stored in separate tables. Relationships are defined with the help of primary and foreign key constraints. A relational database model is designed so as to enable the model to enforce referential integrity between the records stored in the database. The tables are normalized so as to reduce redundancy and provide optimal storage techniques.  

In contrast, in a NoSQL database, a record is usually stored in JSON format. Every column name is stored as an attribute within a single document. Such a model makes sure that data is optimized for horizontal scalability, and is used for flexible and intuitive development. NoSQL databases are a great choice to work with modern applications such as mobile, web, and gaming, since these fields require flexible, scalable, high-performing, and highly functional databases since they help in provisioning exceptional user experience.  

Features of NoSQL databases

  • They provide flexible schemas so that the development is quick and iterative. This kind of flexibility in NoSQL models makes it ideal to be used with semi-structured and unstructured data.  
  • NoSQL databases are designed to be scaled out with the help of distributed clusters of hardware instead of adding robust and expensive servers.  
  • There is a facility provided by certain cloud providers to handle this scaling out of NoSQL databases behind-the-scenes as a fully managed service.  
  • It is optimized to handle specific data models and access patterns so as to provide higher performance, instead of trying to accomplish similar functionalities with relational databases.  
  • They provide highly functional APIs and data types which are custom built to work with respective data models.  
  • NoSQL database makes trade-offs by modifying the ACID properties which is essential and strict in relational databases, thereby providing a much more flexible data model, which has the ability to be scaled horizontally. This is the reason behind using NoSQL wherein high throughput, and low latency are major concerns.  
  • Performance depends on the underlying hardware cluster size and network latency. It changes based on these factors.  
  • NoSQL databases can be partitioned easily since key-value pattern can be a convenient choice to scale out the application with the help of a distributed architecture. Such an architecture helps in increasing the throughput of the application thereby improving the performance consistency.  
  • NoSQL can be used to provide object-based APIs thereby allowing application developers to store and retrieve data from in-memory data structures easily. Partition keys allow the applications to look-up for data based on key-value pairs, column sets or semi-structured documents that store serialized application objects and attributes.  
  • The different types of NoSQL databases are designed to work with OLTPs(online transaction processing) for multiple data access patters. This includes applications which have low latency.  

Types of NoSQL database

There are different types of NoSQL databases. They have been discussed below: 

Key-Value

This type of database can be partitioned and can be scaled horizontally. This is a highlight in the key-value database, which can’t be achieved with other databases. This type of database is used in gaming, ad-tech, and IoT industries. Amazon DynamoDB has been designed to provision consistent single-digit millisecond latency irrespective of the scale of the workloads. This performance plays an important role, and an example is Snapchat Stories feature, which works with DynamoDB.  

Document

In application code, data is represented as object or a JSON document since it is an efficient way to model data. Document database helps in storing and querying data in a database in the same format that is used in their application code. This type of flexible, semi-structured, and hierarchical nature of document databases help in modifying them easily based on the requirements which are modified on-the-go. They work very well with catalogs, user-profiles, and content management systems wherein every document is unique and changes overtime. Examples of document database include MongoDB and Amazon DocumentDB.

Graph

The intuition behind a graph database is to make it easy to build and run applications which work with high connectivity datasets. Use cases of graph databases include (but are not limited to) social networking sites, recommendation engines, fraud detection, and knowledge graphs. One such example is Amazon Neptune, which provides a fully-managed graph database service. It comes with support for Property Graph model and Resource Description framework (RDF) thereby providing two choices for graph APIs- TinkerPop and RDF/SPARQL.  

In-Memory

This type of database is used with applications that work with real-time data which require microsecond response times, and there could be significant spikes in the incoming traffic at any point in time. Some applications which use in-memory databases are gaming and ad-tech apps which need leader boards, session stores, and real time analytics. Amazon ElastiCache provides Memcached and Redis, which help provide low latency, and high throughput workloads. Another example is the Amazon DynamoDB Accelerator (DAX) which is a custom build data storage system. DAX helps in improving the DynamoDB reads.  

Search

Output logs helps developers in troubleshooting certain issues. One such example is Amazon Elastic Search Service which is customized to provide near-real-time visualizations and analytics of data which has been generated by machine with the help of indexing, aggregating and searching large number of semi-structure logs and metrics. ES is a powerful search engine that can be used for full text search use case.  

Conclusion  

In this post, we understood how non-relational databases are different in comparison to relational databases.

Non-relational databases and Relational database

Leave a Reply

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

Comments

tenzin nyima

Whoever has contributed to this article...I would like to say thank you... it has been of good help to the readers.

alvi

This blog is very helpful and informative, and I really learned a lot from it.

alvi

It is very helpful and very informative, and I really learned a lot from this article.

alvi

Such a very useful article. I would like to thank you for the efforts you made in writing this awesome blog.

Jeanne

Very useful and awesome blog!