What is System Design? According to Wikipedia, “Systems Design is the process of defining the architecture, modules, interfaces, and data for a system to satisfy specified requirements”.

This is 100% correct, but is too abstract… In plain words, System Design is a task to:

How is System Design different from Object-Oriented Design?

System Design focuses on the high-level business requirement and workflow, without really worrying about how they are implemented or any code-level details. Example topics for System Design are:

  • Query Per Second (QPS)
  • Load Balancer
  • Web Server
  • Database Server
  • Schema Design
  • SQL vs NoSQL
  • Caching (In-Memory vs Distributed cache)
  • Database Replica, Master/Slave
  • Scalability, etc.

Notice none of these topics require you to think about code in a specific language?

Object-Oriented Design (OOD) focuses more on the code. Great OOD produces code that is readable and easy-to-maintain. Example topics are:

  • Class, Interface
  • Inheritance, Implementation, Extension
  • Abstract, Virtual
  • Methods, Override

Notice you start thinking about code when you see these topics?

Appetizer — Design Tiny URL

This is called an appetizer because Tiny URL is probably the simplest first System Design task to discuss. You can quickly play with the Tiny URL feature in this link. In the future stories, I will work on entrees like Design Twitter.

In short, Tiny URL does two things:

  1. Given a long URL, return a short URL.
  2. For example, I type in https://medium.com/@ss.shawnshi, and may get back something like https://tinyurl.com/y6jbm86w
  3. Given a short URL, return the long URL.
  4. For example, if I visit the short URL https://tinyurl.com/y6jbm86w, I should get the long URL back https://medium.com/@ss.shawnshi (Tiny URL also redirects me to it)

How would you approach this appetizer and design Tiny URL? I will take a stab at it.

First, let’s clarify the business requirements.

I will provide sample clarification for this demo purpose, including some basic math to demonstrate the thinking process.

#tinyurl #interview #backend #database-design #design-systems

System Design — Introduction and Design TinyURL
3.30 GEEK