Table of Contents
Databases
Databases are an essential part of modern computing systems. A database is a collection of organized data, stored and accessed electronically. It allows us to store, retrieve, and manipulate large amounts of information efficiently and accurately.
Whether we are talking about a simple address book or a complex financial system, a database is a crucial tool for storing, organizing, and managing data. In this chapter, we will explore the different types of databases, how they work, and their various applications in our daily lives.
Kinds of Databases
There are several different types of databases, including:
- Relational databases: These are the most common type of database, and they store data in the form of tables with rows and columns. As we discussed earlier, relational databases allow us to easily relate different pieces of data and make connections between them.
- Object-oriented databases: These databases store data in the form of objects, which are self-contained units that contain both data and the methods for manipulating that data.
- NoSQL databases: These databases are designed to handle large amounts of unstructured data, such as social media posts or log files. They do not use the traditional tabular relational database model.
- Graph databases: These databases store data in the form of nodes and edges, which can be used to represent complex relationships between data points.
- In-memory databases: These databases store data in the main memory (RAM) of a computer, rather than on disk. This allows them to process queries much faster than disk-based databases, but they are limited by the amount of memory available.
Relational vs. non-relational
Relational databases
… are databases that store data in tables with relationships to each other. A table typically contains records that contain similar information, and each record is made up of fields that contain specific information. The relationships between the tables are established using foreign keys, which allow data from different tables to be linked together.
Non-relational
… databases, also known as NoSQL databases, do not store data in tables with relationships to each other, but rather as documents, key-value pairs, or graphs. They are generally more flexible and scalable than relational databases and are therefore particularly suitable for rapidly growing amounts of data and applications with high availability requirements. However, they generally offer less functionality for data integrity and data querying compared to relational databases.