Overview - First things first

what is architecture and why does it matter

from martin fowler brief video 14 mins from the article above

step 1 - clarify your requirements

for example, for a twitter-like service:

  1. (C)RUD - will the users of our service be able to post tweets and follow other people
  2. C(R)UD - should we also design to create and display the user's timeline?
  3. Large files - will tweets contain photos and videos
  4. are we focusing on the backend only or are we developing the front-end too?
  5. Go through large amounts of data - will users be able to search tweets?
  6. Data manipulation - Do we need to display hot trending topics?
  7. Difficult features - will there be any push notification for new (or important) tweets?
  8. other questions i can come up with:
    • will the user be able to sort and filter tweets by certain criteria?
    • will the user be able to edit/undo the tweet after posting it?

step 2 - back of envelope estimation

always a good idea to estimate the scale of the system we're going to design.

helps later when:

things to estimate for:

key question: identify how your system is expected to grow.

for example, for a twitter-like service, users will grow, identify the parts that will scale more than linearly. (i guess, identify one-to-many relationships here, or 1:n and m:n relationships)

which will lead to:

<span class="text-highlight">seems like a worked out solution is needed for the tweet thread / reply thread problem</span>

but will not lead to exponentially more ____ per user:

as it scales per-user.

step 3 - system interface definition

define what APIs are expected from the system.

establishes the exact contract expected, and also ensure if we haven't gotten any requirements wrong.

example APIs

postTweet(user_id, tweet_data, tweet_location, user_location, timestamp, ...) generateTimeline(user_id, current_time, user_location, ...) setTweetAsFavourite(user_id, tweet_id, timestamp, ...)

step 4 - defining data model

be able to:

some entities for the twitter-like service:

step 5 - high level design

draw block diagrams with 5-6 boxes representing the core components of the system. needs to identify enough components needed to solve the actual problem from end to end.

for twitter at a high level:

aside: read-heavy workloads vs write-heavy workloads

read-heavy

what is good for read-heavy components

write-heavy

what is good for write-heavy components

stuff that is good for read AND write heavy components

other databases to check out

new databases such as Google Spanner, Azure Data Warehouse, and our eponymous database, MemSQL

this post

aside: what are the core components?

8 commonly used scalable system design patterns

<span class="text-highlight">TODO: learn more about the core components needing consideration</span>

Step 6: Detailed Design

dig deeper into 2-3 major components (based on what the interviewer wants to know more about, their feedback should guide us toward what parts of the system need further discussion).

should be able to:

some questions to consider:

step 7: Identifying and resolving bottlenecks

other components in a system to consider

from here

refs:

picking a database (based on read or write-heavy applications) designing twitter-like

intro