System Design Flashcards
Define: relational database. Give an example.
- Database built around tables.
- They often have keys that point to other values in other tables.
- MySQL is an example
- example implementation: set of tables for a blog: posts, comments, hashtags each have their own table, all linked via some key like ID
Define: non-relational database Give an example.
- does not use a table
- all data linked in one hierarchy
- NoSQL is an example, Firebase Store is an example
- example implementation: blog object, that has posts, comments, and hashtags within it
What type of database uses tables, rows, and keys?
Relational db
Give an example of a relational db
MySQL
Give an example of a non-relational db
NoSQL
You’re given a prompt to design some app, what questions do you ask understand the problem statement?
- what are we being asked to design?
- who is the user and how will they use this system?
- which parts of the system are we expected to design? ie only the core UX? mobile vs web?
Give an example of how you would narrow down the scope of a prompt to system design an app such as netflix
We could look at the purchasing UX, or the core viewer UX, or the media producer UX. Let’s start with core viewer UX. What features within the coreUX do we wanna focus on? So maybe we can start from the content-detail screen, as well was the viewing experience, the post-viewing exerperience UX
is this an example of relational or non relational db? why?
https://imgur.com/XjVAe2V
relational bc there are tables and they are linked by some key
is this an example of relational or non relational db? why?
https://imgur.com/tKpEeyu
Non relational bc there are no tables and bc there is a hierarchy of data
Define concurrency
Executing multiple tasks at the same time but not necessarily simultaneously
What are message queues used for?
- makes it possible for applications to communicate and perform work asynchronously
- example, if posting a tweet, the tweet could be instantly posted to your timeline, but it could take some time before your tweet is actually delivered to all of your followers.
Give an example of what a message queue could be used for
For example, if posting a tweet, the tweet could be instantly posted to your timeline, but it could take some time before your tweet is actually delivered to all of your followers.
Give an example of a message queue tool
Redis (can also do other things)
Define: queue. Give an example.
A line of things waiting to be handled, such as a messaging queue that holds a list of messages to deliver asynchronously.
What are some problems with concurrency?
- race conditions
- deadlocks