Introduction to Databases

Lesson 29 of 25610 min readPremium lesson preview
In this lesson2 sections

Introduction to Databases

A database provides mechanisms for organizing, querying, updating, and protecting data that an application would otherwise need to build around files. Start with the operations a messaging service needs, then examine which database features support them.

Problem statement

Consider a messaging application similar to WhatsApp. To operate reliably, the system must store and retrieve user data, such as contact lists and message history. Although this data could be stored in flat files, that approach introduces several practical limitations:

Limitations of file storage

  • Concurrency: Managing concurrent access by multiple users is difficult.

  • Access control: Granting granular access rights to different users is complex.

  • Scalability: The application must organize data and concurrent access so that growth does not overwhelm its storage path.

  • Search speed: Without an appropriate index or layout, finding a record can require scanning increasing amounts of data.

The rest of this lesson is for Premium members

Premium opens every lesson in this course, along with all questions and solutions on PracHub.