Tech, ExplainedData platforms and AI
Product

Relational database

Rows and tables that point to each other.

BEFORE ITAFTER ITRelational databasePostgreSQLMySQLCOVERSTablesSQLTransactionsJoinsDatabase as aservice (DBaaS)runs andpatches itOpen-sourcedatabase supportfixesslow queriesgives upeach changeChange data capture (CDC)gives upits tablesETL and ELTsuppliesreport dataEmbedded reporting↗ BUSINESS INTELLIGENCECONCEPTS IT USESOLTP and OLAPOpen source business modelBEFORE ITAFTER ITRelational databasePostgreSQLMySQLCOVERSTablesSQLTransactionsJoinsDatabase as aservice (DBaaS)runs andpatches itOpen-sourcedatabase supportfixesslow queriesgives upeach changeChange datacapture (CDC)gives upits tablesETL and ELTsuppliesreport dataEmbeddedreporting↗ BUSINESSINTELLIGENCECONCEPTS IT USESOLTP and OLAPOpen source business modelBEFORE ITDatabase as a service (DBaaS)↓ runs and patches itOpen-source database support↓ fixes slow queriesRelational databasePostgreSQLMySQLTablesSQLTransactionsJoinsAFTER IT↓ gives up each changeChange data capture (CDC)↓ gives up its tablesETL and ELT↓ supplies report dataEmbedded reporting↗ BUSINESS INTELLIGENCECONCEPTS IT USESOLTP and OLAPOpen source business model
The relational database is run and repaired by a managed database service and open-source database support, and its changes and tables are copied out by change data capture, ETL and ELT tools, and embedded reporting.
opens a page inside this one a page in the same scene a page in another scene a concept page a label only, with no page

A relational database is a database that stores data in tables of rows and columns, where rows in one table point to rows in another. Programmers read and write it in SQL, the Structured Query Language. PostgreSQL, MySQL and Oracle Database are well-known examples. It is the most common kind of database behind business software, banking and online shops.

Each table holds one kind of thing. A table of students has one row for each student, and a column for each detail, such as name and phone number. Each row has a unique number, called its primary key. Another table can point to that row by storing the number. This pointer is called a foreign key. Storing each fact only once, and pointing to it from elsewhere, means a change is made in one place only.

A query can then join tables, which means combining rows that point to each other. The database also checks the rules set for each table. For instance, a fee payment cannot point to a student who does not exist.

The most important feature is the transaction. A transaction is a group of changes that must all happen, or none of them. Take, for example, an engineering college in Thiruvananthapuram that runs its admissions on a relational database. It has three tables: students, courses and fee payments. Student number 2041 pays ₹45,000 to confirm a seat in Mechanical Engineering. In one transaction, the app adds a row to the fee payments table and marks her seat as confirmed. If the second change fails, the database undoes the first. So nobody is charged without getting a seat. At the end of the week, one SQL query joins the three tables and lists every confirmed student in each course with the fees received.

The cost of this strictness is that the tables must be designed in advance. Adding a new kind of detail means changing the table, which on a large table needs care. A document database avoids this by storing each record as one flexible document, but it checks less.

PostgreSQL and MySQL are free, open-source software. A company can run them on its own servers, with open-source database support for help when they slow down. Or it can rent them as database as a service (DBaaS). When one server is no longer enough, a distributed SQL database spreads the same tables across many machines.

A relational database does the recording work called OLTP. For questions across years of records, the data is copied out to a warehouse, which is analytical work, or OLAP; the page on OLTP and OLAP explains the split. The copying is done by change data capture or by ETL and ELT tools.

Tech, Explained is a part of ingrid.fyi. Every page explains one piece of technology in plain words.