DEV Community

Grant
Grant

Posted on

Database Types Explained

SQL vs. NoSQL Databases

SQL Databases

SQL databases are built around SQL, or Structured Query Language. Most SQL databases are relational database management systems (RDBMS), which store data that is primarily structured. Structured Query Language has been in existence since the 1970's, and is standardized for use across many RDBMS systems.

SQL Databases are tabular in that they store data in tables with rows and columns. The tables are interconnected through columns shared in common between tables. In the above image, the arrows show the columns that connect the data in various tables. SQL Databases are particularly well suited for systems dealing with transactions, such as customer relations management tools and accounting software. They are not, however, structured in such a manner as to "play well" with object-oriented programming languages, necessitating object-relational mapping tools such as Sequelize. Commonly used SQL Databases include Oracle, MySQL, Microsoft SQL Server, PostgreSQL, Microsoft Access, and SQLite.

NoSQL Databases

NoSQL Databases, as the name implies, generally do not rely on SQL, though some may use SQL-like languages. Some, in fact, say NoSQL stands for "Not only SQL." NoSQL Databases are generally less structured, more diverse, and newer overall than their SQL counterparts. Some common examples are listed below.

Wide Column Store

Wide Column Stores are similar to SQL Databases in that they use tables of rows and columns. The columns, however, can change with each row, creating a 2-dimensional effect. Popular Wide Column Stores include Bigtable, Apache Cassandra, and Azure Tables.

Key-Value Databases

Key-Value Databases are essentially hash tables, both of which can be compared to a dictionary, in which one key (a word entry) corresponds to many underlying fields of information. The underlying fields for the keys in Key-Value Databases can vary from key to key, lending the system a great deal of flexibility in the data it can store. The key-value-pair system matches well with object-oriented programming, and since a key's values are not predetermined with placeholders as in a table, databases of this type perform very well in certain circumstances. Notable Key-Value Databases are Redis, Oracle NoSQL Database, Amazon DynamoDB, Infinity DB, and Oracle Berkeley DB.

Graph Databases

Graph Databases are suited for data that is highly interconnected, because of the "relationships" (also known as "edges") it maintains between nodes. As a result, complex data lookup can perform very highly because of the existing connections between data. Since SQL databases implicitly compare tables of highly ordered data, SQL is poorly suited to the nature of Graphs, in which the relationships are a concrete part of the data structure. Graphs, in fact, do not have a standardized language, and usually rely on a proprietary system. Common Graph Databases are Neo4j, Orient DB, Titan DB, and Apache Giraph.

Document-Oriented Databases

Document-Oriented Databases are one of the most prominent types of non-relational databases, and are actually a variety of Key-Value Database. They differ mainly in the way the database engine processes the data, rather than their structure. Documents are very closely related to objects in programming languages, and documents are very flexible. They can have any number of fields and fields can vary between documents. Documents themselves each have a unique key used to retrieve the documents itself, and they keys often have an index to hasten lookup. Prominent Document-Oriented Databases include MongoDB, Amazon DynamoDB, Google Cloud Firestore, ArangoDB, and Couchbase Server.

Top comments (0)