Archi's Academy

GetStarted

GetStarted
Get in touch

Computer Science

Computer programming

Databases

When it comes to choosing a database for your project, the options are countless. That being said, most databases will fall into two categories: SQL and NoSQL databases. Both have their pros and cons but first let’s understand the meaning of each term.

SQL

SQL is an acronym for ‘Structured Query Language’. It’s a domain specific programming language that is used for CRUD operations within a RDMS (Relational Database Management System). It is mainly used for managing structured data where we have a relationship between various entities and variables of the data.

SQL consists of various types of statements that are used to query the data stored in the databases.

DML - Data Manipulation Language

These types of statements are used for performing the CRUD operations in the database. Examples of common DML commands in SQL are SELECT, INSERT, UPDATE and DELETE.

DCL - Data Control Language

Such statements are used to control access and provide authorization to the database. Some examples of common DCL commands in SQL are GRANT and REVOKE.

DDL - Data Definition Language

These are the statements or queries that are used to create and modify schemas. Examples of common DDL commands in SQL include CREATE, ALTER, and DROP.

TCL - Transaction Control Language

These statements are used for controlling and managing transactions to maintain data integrity. Some examples of common TCL commands in SQL include BEGIN, COMMIT, and ROLLBACK.

NoSQL

NoSQL is an abbreviation used to refer to “Not Only SQL”/ “Non-SQL” / “non-relational” databases. These types of databases are different compared to SQL databases. In these databases, data is managed in a non-relational form, that means the data is not necessarily structured in a tabular manner and it does not possess tabular relationships.

NoSQL is an alternative to conventional relational SQL databases whereby data is placed into tables and the data structure, or schema, is carefully designed before the database is actually created. It is mainly useful when working with very large sets of distributed data. NoSQL databases tend to be scalable, high-performing and flexible in nature.

Types of NoSQL Databases

Column

Stores and arranges the data tables as columns rather than as rows. They can query a large volume of data much faster than traditional relational databases. They can be used for recommendation engines, catalogues, fraud detection, etc. Examples: Cassandra, HBase, Google BigTable, Scylla, Vertica, etc.

Document

Document databases store semi-structured data along with their description in the document format. Each document has a unique key through which it is addressed.

They are helpful for content management and mobile application data handling. Document databases are widely used with JSON and JavaScript. They also offer an API and query language through which the documents can be fetched based on their contents.

Examples: Apache, MongoDB, MarkLogic, CouchDB, BaseX, IBM Domino, etc.

Key-value

Key-value databases have their data-model based on an associative array (map or a dictionary) in which the data is represented by a collection of key-value pairs. They are highly suitable for session management and caching in web applications.

Examples: Aerospike, Berkeley DB, Apache ignites, Dynamo, Redis, Riak, ZooKeeper, etc.

Graph

In graph databases, data is organized as nodes and edges. Nodes can be thought of as records and edgee as a relationship between the records in the relational database. This model supports a richer representation of data relationships. Graph databases are useful for customer relationship management systems, road maps, reservation systems, etc.

Examples: AllegroGraph, InfiniteGraph, MarkLogic, Neo4j, IBM graph, Titan, etc.

Differences Between SQL and NoSQL Databases

SQL-1.png SQL-2.png

Conclusion

NoSQL databases are gaining huge popularity these days due to their capacity to integrate big data, low cost, easy scalability, and open source features. However, it is still a relatively new technology and lacks standardization, unlike SQL. Lack of ACID compliance is also a concern with NoSQL. The choice of the database used in your projects will always depend upon your preferences, business requirements, volume, and variety of data.

That was all about SQL vs NoSQL Databases, drop a like and share it if you found it informative.

Goodbye have a nice day, meet you in next blog!

software development team lead

Kumbukani Kamanga

Friday, Nov 5, 2021