Choosing the right database for storing your data is not always an easy choice. In fact, if in the first instance, the use of a relational database might seem more natural, in some cases this choice may not be successful.
In this article I try to describe the differences between relational and non-relational databases, trying to highlight their pros and cons.
A Relational Database is a collection of items with pre-established relationships among them. All the items are organised in tables, where columns represent items attributes. Every row of a table represents a single data item.
In order to identify each item in a table uniquely, a primary key should be defined for each table. A primary key could contain one or more columns of a table. Multiple tables could be related through different foreign keys.
A Relational Database could be queried in different ways, without altering the tables structures. The Structured Query Language (SQL) is the most famous interface used to communicate with a Relational Database.
Examples of SQL database engine are:
- Microsoft SQL Server
Summarising, in a Relational Database all the information is structured, i.e. it is organised in tables.
Great for structured data
Use of an existing query language (SQL)
Great for complex queries
Easy data navigation
High level of data integration, due to relationships and constraints among tables
Transactions are secure
Up-front schema definition
No adaptation to changing requirements: dynamic changes to an item affect all the other items in the same table
Data processing may be slow. High performance is possible with expensive hardware