← Back to Databases

Why databases exist

Almost every application, from banking to social media, depends on a database. A database management system does far more than store data: it keeps data correct, shared, secure, and available.

Life before databases

Early business systems stored data in separate files owned by individual programs. The same customer's address might appear in billing, shipping, and marketing files, each slightly different. Changing a file's format meant rewriting every program that read it, and two programs updating the same file at once could corrupt it.

What a DBMS provides

A database management system (DBMS) sits between applications and stored data. It provides a data model for describing data, a query language for retrieving it, integrity enforcement, concurrent access for many users, crash recovery, security and access control, and efficient storage and indexing. Applications describe what they want; the DBMS works out how.

Data independence

A key goal is data independence. Physical data independence means storage details, such as file layout or indexes, can change without changing applications. Logical data independence means the overall schema can evolve, for example by adding a column, while existing applications and views keep working. This separation is often described in three levels: physical, conceptual (logical), and external (views).

Schemas and instances

A schema describes the structure of a database: its tables, columns, types, and constraints. It changes rarely. An instance is the actual data stored at a given moment, which changes constantly. The schema is like a building's floor plan; the instance is the people and furniture inside it today.

Data models through history

The hierarchical model, as in IBM's IMS from the 1960s, stored records in trees. The network model allowed more general links. In 1970, Edgar F. Codd's paper 'A Relational Model of Data for Large Shared Data Banks' proposed storing data as mathematical relations, separating logical structure from physical access paths. IBM's System R and the University of California's Ingres turned the idea into working systems in the 1970s.

The database landscape

Relational databases such as PostgreSQL, MySQL, SQLite, Oracle Database, and Microsoft SQL Server remain dominant. SQLite, embedded in phones, browsers, and countless apps, is likely the most widely deployed database engine in the world. Non-relational (NoSQL) systems, data warehouses, and cloud-managed services complement them for particular workloads.

Who works with databases

Application developers write queries and design schemas; database administrators (DBAs) manage performance, backups, security, and upgrades; data engineers build pipelines that move and transform data; and analysts and data scientists query data for insight. Increasingly, cloud providers take over much of the administration as managed services.

Worked example

A small online shop keeps customers, products, and orders. Using separate spreadsheets, a customer who moves must be updated in several files, and two staff editing the stock sheet simultaneously can overwrite each other's changes. In a DBMS, the address is stored once, every order refers to it, stock updates run as transactions so concurrent sales cannot oversell, and a crash mid-update is rolled back automatically.

Key takeaways

File-based systems suffered from duplication, inconsistency, rigid formats, and unsafe concurrent access. A DBMS provides a data model, query language, integrity, concurrency control, recovery, security, and efficient storage. Physical and logical data independence separate applications from storage and schema changes. A schema is the structure; an instance is the current data. Codd's 1970 relational model, built in System R and Ingres, displaced hierarchical and network models. PostgreSQL, MySQL, SQLite, Oracle, and SQL Server lead today, with SQLite the most widely deployed.

Flashcard

DBMS

Database management system

Stores, protects, serves data.

Check your understanding

A company adds an index to speed up searches, and no application code has to change. Which property does this show?

Next lesson →