Links to Study

Deepak Pant
3 min readMar 15, 2020

Cassandra modelling

Write heavy workload. Choose DB with LSM indexed DB

General difference between sql and no-sql

dropbox system design by Naren

Netflix stream processsing

SHA perfomance metrics

Youtube scaling

Indexing / Search Engine

ngnx

Haproxy architecure

http://www.haproxy.org/download/1.2/doc/architecture.txt

Strore session in centralied location

Load Balancer

HAProxy Config

Scaling storage

Scale timeseries databases in netflix

Netflix timeseries db

Kafka Design

Live stream architecure.

Location based search + quadtree

Generating Global Unique ID

  1. clocks across different computer are not synchronous all the time
  2. NTP sometime roll back the time if it detect the computer clock is diverging (due to clock skew drift issues)
  3. Using get_time_of_day() usec+counter+machine_name might be globally unique but slow because get_time_of_day() is slow. Also it might not be monotonically increasing (see #2)
  4. get UUID in windows / DB’s can generate system specific globlal UID
  5. if you need monotonically increasing global ids (you want to sequence events), best option is to just have a single server from where everyone ask for a unique id
  6. gettimeofday() gives UTC time (sec,microsecond). but gettimeofday is slower. So you can just use machine_name+counter if you want speed. you have to backup the counter state once in a while.

Flikr approach: (distributed unique primary keys)

Use mysql auto incr counter with only storing the last incremented number in DB (so that the size of the db dont grow). Use REPLACE INTO command

Zookeeper.

  1. Writes goes to the leader. OK is only sent when quorum writes happes.

2. Read happens with any server. read can be stale for a while(eventual consitent)

3 Watch can be set for any ephimeral node

4. can be used for service discovery

--

--