Skip to content

Latest commit

 

History

History
106 lines (91 loc) · 4.63 KB

System_Design.md

File metadata and controls

106 lines (91 loc) · 4.63 KB

Tushar Roy (Introduction to System Design)

ABCD of System Design

  • A - Always ask good questions
  • B - Buzz Words NO NO NO (Don't use words without proper knowledge or which you found out by quick researching for 10 minutes the previous day)
  • C - Clear and Organized Thinking
  • D - Drive Discussions (80 myself - 20 interviewr should speak Rule)

Things to consider

  1. Features
  2. API
  3. Availability
  4. Latency
  5. Scalability
  6. Durability
  7. Class Diagram
  8. Security and Privacy
  9. Cost-effective

Must know concepts for System Design Questions

  1. CAP Theory -> Consistency - Availability - Partition Tolerance
    • Difference between SQL and NoSQL Databases (Which Database chooses what? over the above 3 (CAP))?
  2. Vertical Scaling (Increasing System Resources like Memory RAM, etc) or Horizontal Scaling (Increasing Number of Hosts - Making Distributed System)
  3. acid vs base database
  4. Partitioning or Sharding of Data (What is Consistent Hashing)
  5. Optimisstic Vs Pessimistic Locking in databases
  6. Strong vs Eventual Consistency
  7. Relational DB (follows ACID) vs NoSQL
  8. Types of NoSQL Databases
  • Key-Value Pair
  • Wide Column
  • Document based
  • Graph Based
  1. Caching
  2. Data Centers, Racks and Hosts
  3. CPU, Memory, Harddrive, Network Bandwidth
  4. Random vs Sequential Read/Write on Disk
  5. Http / Https vs WebSockets
  6. TCP / IP Model
  7. IPV4 vs IPV6
  8. TCP vs UDP
  9. DNS Look up
  10. Https and TLS
  11. Public Key Infrastructure & Certificate Authority
  12. Symmetric vs Asymmetric Key
  13. Load Balancer - L4 vs L7
  14. CDNs and Edge
  15. Bloom Filters and Count Min Sketch
  16. Paxos - Consensus over Distributed hosts, Leader Election
  17. Design Patterns and Object Oriented Design
  18. Virtual Machines and Containers
  19. Publisher Subscriber or Queue
  20. Map Reduce
  21. Multi threading, concurrency, locks and synchronization, CAS (Compare and Swap)

Some of the Tools that have implemented the above concepts

  1. Cassandra - 22:50
  2. MongoDB/Couchbase - 23:22
  3. Mysql - 22:36
  4. Memcached - 23:52
  5. Redis - 23:52
  6. Zookeeper - 24:30
  7. Kafka - 25:00
  8. NGINX - 25:17
  9. HAProxy - 25:17
  10. Solr, Elastic search - 25:32
  11. Amazon S3 - 25:45
  12. Docker, Kubernetes, Mesos - 26:00
  13. Hadoop/Spark and HDFS - 26:17

References

https://docs.datastax.com/en/cassandr... http://cloudurable.com/blog/kafka-arc... https://zookeeper.apache.org/doc/trun... http://www.allthingsdistributed.com/f... https://research.google.com/archive/b... https://en.wikipedia.org/wiki/CAP_the... https://en.wikipedia.org/wiki/Consist... https://www.mongodb.com/mongodb-archi... https://en.wikipedia.org/wiki/HTTP/2 https://en.wikipedia.org/wiki/Transpo...

Video 2

System Design : Design a service like TinyUrl

Video 3

Design messaging/chat service like Facebook Messenger or Whatsapp

  1. Facebook - Text messages within the chat are not encrypted
  2. Whatsapp / Signal - Text messages within the chat are encrypted. (Even company cannot read it).
  3. Cassandra DB - Cassandra is a free and open-source, distributed, wide-column store, NoSQL database management system designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure.
  4. Redis DB (For Distributed Cache) - What is Redis database? What is Redis? Redis, which stands for Remote Dictionary Server, is a fast, open source, in-memory, key-value data store. Redis is an open source (BSD licensed), in-memory data structure store used as a database, cache, message broker, and streaming engine. Redis provides data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams.
  5. WebSocket - is a bidirectional communication protocol that can send the data from the client to the server or from the server to the client by reusing the established connection channel. The connection is kept alive until terminated by either the client or the server.
  6. HTTP - it is unidirectional (request -> response type). Server cannot initiate a communication by itself. In our scenario it is not helpful
  7. 3 users, 3 servers, load balancer, various tables within the database.
  8. Blob Storage - Blob storage enables companies to keep large amounts of data secured and stored within a Microsoft Azure storage account. Blob storage is a convenient, cost-effective and highly scalable cloud-based method of object storage. BLOB - Binary Large Object