Important Concept of System Design

1: Database Isolation Levels: Database isolation Level allows to execute if there is no concurrent transactions.

2: HTTPS:

client server Connection

client-> client Hello->: server

Why does HTTPS switch to symmetric encryption during data
transmission? There are two main reasons:

  1. Security: The asymmetric encryption goes only one way. This means
    that if the server tries to send the encrypted data back to the client,
    anyone can decrypt the data using the public key.
  2. Server resources: The asymmetric encryption adds quite a lot of
    mathematical overhead. It is not suitable for data transmissions in long
    sessions.
    Over to you: how much performance overhead does HTTPS add,
    compared to HTTP? Not Much.

3:SQL Vs No SQL

Data can be structured (SQL table schema), semi-structured (JSON,
XML, etc.), and unstructured (Blob).

4: ๐๐ฅ๐จ๐จ๐ฆ ๐Ÿ๐ข๐ฅ๐ญ๐ž๐ซ.

How to avoid crawling duplicate URLs at Google scale?
Option 1: Use a Set data structure to check if a URL already exists or
not. Set is fast, but it is not space-efficient.
Option 2: Store URLs in a database and check if a new URL is in the
database. This can work but the load to the database will be very high.
Option 3: ๐๐ฅ๐จ๐จ๐ฆ ๐Ÿ๐ข๐ฅ๐ญ๐ž๐ซ. This option is preferred. Bloom filter was
proposed by Burton Howard Bloom in 1970. It is a probabilistic data
structure that is used to test whether an element is a member of a set.
๐Ÿ”นfalse: the element is definitely not in the set.
๐Ÿ”นtrue: the element is probably in the set.
False-positive matches are possible, but false negatives are not.
The diagram below illustrates how the Bloom filter works. The basic
data structure for the Bloom filter is Bit Vector. Each bit represents a
hashed value.

5:HTTP 1.0 -> HTTP 1.1 -> HTTP 2.0 -> HTTP 3.0 (QUIC).


๐Ÿ”นHTTP 1.0 was finalized and fully documented in 1996. Every
request to the same server requires a separate TCP connection.
๐Ÿ”นHTTP 1.1 was published in 1997. A TCP connection can be left
open for reuse (persistent connection), but it doesnโ€™t solve the HOL
(head-of-line) blocking issue.
HOL blocking – when the number of allowed parallel requests in the
browser is used up, subsequent requests need to wait for the former
ones to complete

HTTP 2.0 was published in 2015. It addresses HOL issue through
request multiplexing, which eliminates HOL blocking at the application
layer, but HOL still exists at the transport (TCP) layer.
As you can see in the diagram, HTTP 2.0 introduced the concept of
HTTP โ€œstreamsโ€: an abstraction that allows multiplexing different HTTP
exchanges onto the same TCP connection. Each stream doesnโ€™t need
to be sent in order.
๐Ÿ”นHTTP 3.0 first draft was published in 2020. It is the proposed
successor to HTTP 2.0. It uses QUIC instead of TCP for the underlying
transport protocol, thus removing HOL blocking in the transport layer.
QUIC is based on UDP. It introduces streams as first-class citizens at
the transport layer. QUIC streams share the same QUIC connection,
so no additional handshakes and slow starts are required to create
new ones, but QUIC streams are delivered independently such that in
most cases packet loss affecting one stream doesn’t affect others.

6: SOAP vs REST vs GraphQL vs RPC.

Design a site like this with WordPress.com
Get started