Practice this topic in a realistic system design interview
In this chapter, we'll look at how to design the data layer in a system design interview.
We'll start by identifying what the database needs to support, choosing a suitable database, and modeling data in relational and NoSQL systems. Then we'll cover the areas interviewers often explore further: indexes, transactions, concurrent updates, partition keys, replication, sharding, and keeping multiple data stores in sync.
We'll use a photo-sharing app similar to Instagram as our main example, and an online store for transactions.
In most system design interviews, you'll discuss the database schema after defining the APIs or while developing the high-level design. By this point, you should have a clear idea of the main entities and the operations your system needs to support.
Database design is about deciding: