Data persistence with Database

Adding persistence to application means storing data so that it persists beyond the lifetime of the application. This is typically achieved by storing application data in a database.

What is a database?

A database is a shared collection of related data.

There are many types of databases. A relational database is a data model that stores the data as "a collection of inter-related relations (or tables)." It is the most popular and widely used type of database.

The relationship between data (which is captured by the relationship between tables) is a kind of meta-data (data about data) which further adds value to the application of this data model.

Table

Relational databases are made up of tables. A table is a collection of related data held in a tabular format where

  • Each row is unique and represents a record.
  • Each column has a unique name and represents an attribute.
  • Column values are of the same kind.
  • The sequence of columns/rows is insignificant.

Databases almost always come with a Database Management System (DBMS) that provides a convenient environment to create, secure and maintain databases. Relational DBMS (or RDBMS) are software services that facilitate working with relational databases. Over the decades, many RDBMS have been developed for different uses. Each RDBMS is tuned to best provide certain features (such as performance, scalability, simplicity, etc.). Every RDBMS provides an application programming interface (API) for user to work with the database. The API is commonly in form of a querying language that conforms (in most parts) to the standard Structured Querying Language (SQL). SQL is a hallmark of relational databases; other database types are often referred to as NoSQL databases.

For brevity, from this point on, I use the term "database" to refer to a (relational) database together with its (R)DBMS application (server).