Jump to research

Composed by

Profile picture

a. r.

Views

39

Version history

a. r., 588d ago

September 15, 2023

Different types of nosql databases

My research process involved examining multiple Reddit discussions and articles related to different types of NoSQL databases, their advantages, and use cases. Although there were various opinions and experiences shared, there seemed to be a general consensus that NoSQL databases are best suited for specific use cases and should not be used as a default choice over relational databases. The sources were directly related to the query, but there might still be some uncertainty due to differing opinions and experiences.

Have an opinion? Send us proposed edits/additions and we may incorporate them into this article with credit.

Words

407

Time

2m 29s

Contributors

96

Words read

20.7k

Key-Value Databases

Key-value databases are considered the simplest and most scalable type of NoSQL database, offering flexibility and improved performance. They organize data in pairs of keys and values, where each key is tied to a specific object representing a data field. Redis, Aerospike, and Riak are popular examples of key-value NoSQL databases. Key-value databases are commonly used for caching, storing, and managing user sessions, ad servicing, and recommendations.

Document-Based NoSQL Databases

Document-based databases store data in key-value pairs within documents and are grouped into collections based on their content and use. They are suitable for cases that require a flexible structure and the ability to quickly add and retrieve data. MongoDB, Couchbase Server, CouchDB, and Elasticsearch are popular examples of document-based NoSQL databases. These databases are ideal for managing user profiles that differ according to the information provided.

Graph-Based Databases

Graph-based databases represent data as a collection of nodes (data elements) connected by edges, making them suitable for representing relationships between different data entries such as friend connections on social networks. Popular examples of graph-based NoSQL databases are Neo4J, OrientDB, RedisGraph, and InfiniteGraph. Graph databases are less commonly used compared to other NoSQL databases due to their specific data-storing approach.

Wide Column-Based Databases

Wide column-based databases store data into separate columns and are highly flexible, allowing variations in column names and even adding new columns in real-time. They can store vast amounts of data within a single column, making them more efficient for handling large datasets. Popular wide column-based databases include Cassandra, Cosmos DB, HBase, and Accumulo.

When to Use NoSQL Databases

NoSQL databases should be considered when there are specific performance bottlenecks in relational databases, or when unstructured data is involved. They are also suitable when data access patterns are predominantly by ids and single documents. However, relational databases should generally be the default choice, and NoSQL databases should only be considered if the specific needs are not met by relational databases.

Jump to top

Research

"https://phoenixnap.com/kb/nosql-database-list"

  • NoSQL databases are alternatives to traditional databases, aimed at capturing and processing large amounts of data, which cannot be handled by traditional databases. Instead of organizing data into tables, NoSQL databases store data in ways that better reflect the needs of modern data, providing flexibility, scalability, and improved performance.

  • NoSQL databases offer several types, each with a unique approach to data modeling and different use cases. The four popular types of NoSQL databases are key-value databases, document-based databases, graph-based databases, and wide column-based databases.

  • Key-value databases organize data in pairs of keys and values, which provide maximum scalability, flexibility, and performance. Redis, Aerospike, and Riak are some popular examples of key-value NoSQL databases.

  • Document-based databases also use key-value pairs and store them into documents, further grouping them into collections based on their content and use. These databases most commonly store data as JSON, XML, BSON, or YAML forms, usually without implementing a schema. This approach makes them suitable for cases that require a flexible structure and the ability to add and retrieve data quickly. MongoDB, Couchbase Server, CouchDB, and Elasticsearch are popular examples of document-based NoSQL databases.

  • Graph-based databases represent data as a collection of nodes (data elements) connected by edges. Nodes contain pieces of data, while edges define relationships between them. This database type is commonly used to represent relationships between different data entries, such as friend connections on social networks. Popular examples of graph-based NoSQL databases are Neo4J, OrientDB, RedisGraph, and InfiniteGraph.

  • Wide column-based databases store data into separate columns, similar to how data is stored in tables with relational databases. However, unlike relational databases, wide-column databases do not use predefined keys or column names. This allows for variations in column names, even within the same table, and easy integration with other big data solutions. Popular examples of wide column-based NoSQL databases are Cassandra, Cosmos DB, HBase, and Accumulo.

  • Object databases store data elements as objects to be used in object-oriented programming languages like Python, Ruby, Delphi, or Java. These databases provide high performance and scalability and work best for specific use cases. Examples of object-based NoSQL databases are ObjectDB, Ninja Database Pro, and NeoDB.

  • Grid and cloud databases use a data grid - a network of systems working with data accessible through the cloud. This type of database works with both SQL and NoSQL data models and is typically offered as a database-as-a-service

"Looking for good use cases for NoSQL"

  • The Reddit post titled “Looking for good use cases for NoSQL” is discussing the pros and cons of different types of NoSQL databases like MongoDB and Gremlin.
  • One user suggests that NoSQL is best suited when you have to start denormalizing an RDBMS due to specific performance bottlenecks and recommends starting with NoSQL if you can foresee this happening.
  • Another user argues that NoSQL should not be used as a more flexible alternative to a relational DB, but rather for offloading highly specific workloads from an RDBMS to dedicated NoSQL solutions like Elasticsearch.
  • A third user suggests that NoSQL is better suited for storing documents together rather than storing relational data and that most of the time one would only need to retrieve the full document by ID.
  • Yet another user provides two blog posts with reasons both for and against using a NoSQL database and argues that many projects and teams have real obstacles to NoSQL adoption, including a lack of skills and unclear requirements or access patterns.
  • One user suggests that NoSQL databases like MongoDB are better suited for big data and provide better scalability and ease of use than RDBMS could.
  • Another user argues that companies should avoid deciding on a database type from the get-go and instead look more at the requirements of their projects and choose a database system accordingly.
  • One user suggests that companies should not be tempted to use an RDBMS just because it’s necessary to store relational data, as the data is rarely so trivial that it can be represented by a single table/collection.
  • Another user responds to this comment by saying that, in their current experience, they rarely need to store relational data outside the box and that it’s much more important to store documents together.
  • One user also recommends using Apache Solr if an indexing feature is needed for a NoSQL database.
  • Another user argues that NoSQL is not a one-size-fits-all solution and that companies should use NoSQL databases only for specific cases like high scalability, high write rate or graph traversal operations.
  • One user adds that NoSQL databases could be used in cases where companies need to store and retrieve schema-less data.
  • Finally, another user points out that the choice between NoSQL and RDBMS databases all depends on the use case and that the two types of databases shouldn’t be compared directly as they serve different purposes.

"where and when should I use NoSQL and SQL for an application?"

  • Many companies use both NoSQL and relational databases in their companies.
  • SQL is easy to understand and more universal for data querying language than some proprietary NoSQL query syntaxes.
  • NoSQL databases work for specific edge cases, such as spreading large blocks of data across multiple servers and have it auto-failover and auto-replicate, or having unstructured data and ingesting them quickly for indexing on simple key=value pairs. Some examples: 10 use cases where NoSQL will outperform SQL.
  • For relatively small data entities with many relationships between them, use a relational or SQL database. This option is also for queries on multiple properties of the same object in many places in an application to get lists.
  • NoSQL databases work best when the data access pattern is predominantly by ids and uses single documents.
  • When storing is cheaper than computing, use NoSQL. When computing is cheaper, use SQL.
  • Use SQL until hitting a real roadblock that SQL cannot handle or perform well on, then investigate NoSQL and GraphSQL approaches.
  • A hybrid approach is possible, where all data sits in SQL, and then portions of it are “cache out” to a NoSQL database for those times specific tasks that it handles better.
  • Most NoSQL databases are very specialized tools that just do one thing well, so they are used for that purpose by copying data, while relational databases are “kinda good” at almost everything except for when great text search capabilities are needed, in which case something like Elastic search is used. For session state cache, Redis is used.
  • Relational databases should always be the default choice.
  • SQL is the best choice because it requires little effort to make it efficient and it provides strong consistency guarantees. NoSQL is suitable when data is not a good fit for relational tables, or when processing so much data that overhead for consistency is too much.
  • NoSQL stores are a broad term that generally means non-relational databases.
  • A Reddit user suggests using PostGreSQL with its support of JSON blobs to get the best of both worlds in a performant package.
  • A Reddit user suggests starting with what one is comfortable and familiar with (aka SQL), and then adding NoSQL as needed and fitting its needs.
  • Adding NoSQL and SQL together is a valid option for solving specific problems that none of them can solve alone.
  • A Reddit user suggests using relational databases as the “master database,” and offloading certain types of queries to other databases or search engines as most data is relational, and relational

"can someone explain me a legitimate use case for NoSQL?"

  • The webpage is a discussion thread on Reddit, focused on the use cases for NoSQL databases.
  • One Reddit user asks what NoSQL databases are solving that a well-crafted SQL data model can’t handle and mentions unstructured data (like a JSON blob) as an example of where NoSQL might be used.
  • Another Reddit user responds that there are a plethora of applications for NoSQL databases, and a good implementation will use a mix of non-SQL datastores and SQL.
  • The same user provides the following use cases for NoSQL databases:
    • Application Cache: Write infrequently changing objects from the application to a cache store and read from the cache instead of the SQL database to free up resources on the DB server.
    • Full Text Search: Use another datastore for text searching that is faster than SQL for that operation. Return the ID of the object in the SQL database from the search, so you have an ID to query the SQL database for instead of implementing full text querying on the DB server itself.
    • Object Stores: For data that is either not storable in SQL or doesn’t have a schema to begin with - images, configuration files, geospatial objects, etc. Store metadata about these objects in SQL, but the objects themselves are stored elsewhere.
    • Simple Databases: Sometimes you don’t have highly relational data, so there’s no need for SQL.
  • Another Reddit user agrees with the first user that SQL support for XML and JSON makes a lot of the NoSQL use cases moot. However, it’s better to separate certain functionalities to dedicate more of your SQL DB server’s resources to managing transactions and not searching through blob data.
  • Two users debate whether S3 is itself a NoSQL implementation, with one arguing that it’s a highly scalable key-value store.
  • One user notes that they’ve needed to use NoSQL to handle the volume of unstructured data that needs to be structured/aggregated and brought into a SQL instance.
  • Several other users discuss the meaning of the acronym NoSQL, with some arguing that it means “Not Only SQL,” while others argue it’s a misnomer because SQL is a query language and not a database type.
  • One user gives an example of a NoSQL schema for a messaging or commenting system, which is less normalized but more efficient.
  • Another user argues that NoSQL is optimized for things that can’t be normalized and is less bound by the “shape” of the data.
  • Overall, the discussion suggests that NoSQL databases are useful for

"https://phoenixnap.com/kb/nosql-database-types"

  • NoSQL is an alternative to traditional SQL databases, where relational databases were found to be inadequate for specific use cases.
  • Different types of NoSQL databases exist: Key-value, Document, Wide-Column, and Graph.
  • Key-Value databases have a simple dictionary data structure that enables horizontal scaling of large amounts of data.
  • They contain a set of objects representing fields of data, each with a unique key assigned to it.
  • To retrieve data stored in a particular object, users need to use a specific key assigned to the object.
  • They do not require a predefined structure, making them more flexible in storing data.
  • Key-value databases are used commonly for caching, storing, and managing user sessions, ad servicing, and recommendations.
  • Redis, Project Voldemort, and Riak are the popular kinds of key-value NoSQL databases.
  • Document databases comprise sets of key-value pairs, where documents are created as the basic units of data, grouped into collections based on their functionality.
  • These databases allow users to store data without implementing a schema.
  • Users can transfer the object model directly into a document using different formats such as BSON, JSON, and XML.
  • Document databases optimize continuous and repeatable development, are ideal in managing user profiles that differ according to the information provided.
  • Examples of NoSQL document databases include MongoDB, Elasticsearch, and CouchDB.
  • Wide-column stores are similar to tables in relational databases and organize information into columns that are stored separately instead of rows.
  • Over traditional databases, they are highly flexible, with no predefined column names, allowing varying column names and even adding columns in real-time.
  • They can store vast amounts of data within a single column, which reduces disk resources and the time needed to retrieve data.
  • Wide-column databases are excellent when users have to spread data across multiple servers.
  • Examples of popular wide-column databases include Apache Cassandra, CosmoDB, and HBase.
  • Graph databases use graphical representation to manage data, with nodes (for storing data entities) and edges (for storing relationships between entities).
  • Such relationships between entities allow data in the store to be linked together directly and retrieved with one operation.
  • Graph databases are suitable for specific use cases. Social networks often use graphs to store information about how their users are linked.
  • Examples of graph databases include RedisGraph, Neo4j, and OrientDB.

"What are the advantages of using NoSQL databases vs relational databases?"

  • An initial thought is that it is quick and easy to get initial data into something like Mongo, but more difficult to get data out efficiently in a variety of ways. It works fine if all you need to do later is read full documents selected by key.
  • With an RDBMS, developers have to have a reasonable schema to start and code applications in ways that properly allow for changes to the schema. As long as the schema is decently close to right, it is more efficient than a document DB to get data out in most forms and is usually faster to update.
  • Both require experts or well-designed clouds to handle infrastructure properly for any kind of scale or high availability, but both can be set up by anyone if you don’t care about some of the niceties like uptime. Many relational databases will err on the side of data consistency, while some document databases sacrifice consistency for availability.
  • There are many special purpose No/New SQL options that might serve a particular use case well. Key/value stores are not recommended as they misrepresent data structure. Graph databases might be useful and more efficient for some types of data access patterns.
  • The default should be a relational DB, likely whatever one the company has the most experience with, and if it does not meet the needs, only then should other options be considered, digging into the details of what matters and each option before choosing one.
  • NoSQL databases were developed to deal with large amounts of unstructured data. They do not have the same data consistency requirements as relational databases - consistency is dependent on the use case. If flexibility is much less important than brainless write/read scale, document stores might be the best option.
  • MongoDB does not have any advantages over RDBMS. Generally, NoSQL has advantages over RDBMS.
  • NoSQL includes data engines such as graph databases, column store databases, and resilient row-store systems.
  • CosmosDB is much different from DynamoDB is much different from MongoDB, etc.
  • PostgreSQL is much preferred by many people as it provides flexibility between document store and relational options.
  • When using a document store, if your application finds much success and needs new features, analytics, processing, etc, you’re going to have to do a lot more work to make a document store work for you. If you had chosen a relational database, you’d be able to just keep adding those features.
  • Databases like MongoDB can be incredibly slow and difficult to work with if your reads don’t match the storage format, so you must plan your

💭  Looking into

Comparison of NoSQL databases to relational databases

💭  Looking into

A summary of key features of each type of NoSQL database