Attic › Computer science › Database
A database organizes data so that software can find and update it quickly and safely
A database is an organized collection of digital data stored in a computer. Application software uses a special program called a database management system (DBMS) to read and change this data instead of saving it directly into plain files.
A computer's file system stores data in separate documents, such as text files or spreadsheets. This works well for one person at a time, but it causes problems when a program must manage millions of records for many users.
If an online store keeps its orders in a plain text file, two main problems happen:
1. Slow searches: To find one customer's order, the computer must read the file from the beginning until it finds the right line.
2. Overwritten changes: If two customers buy the last item at the same time, both programs read the file, see one item left, and write a new file. One change overwrites the other, and the store sells the same item twice.
A DBMS—such as PostgreSQL, MySQL, or Oracle Database—solves these problems. It acts as a gatekeeper between the application software and the physical files on the disk. The application never touches the files directly. Instead, it asks the DBMS to read or write data.
The DBMS keeps internal maps of the data so it can jump straight to a specific record without reading the whole disk. It also controls the order of changes when thousands of users connect at the same time, and it enforces rules so that bad data—like a negative price or a missing address—cannot enter the system. People often use the word "database" to mean both the data itself and the DBMS software that manages it.
Fact-checked against Database on Wikipedia
Part of the Computer science syllabus: Algorithms and Data Structures
See it on the timeline of Computer science