System Design Gossip protocol Gossip protocol (a.k.a Epidemic protocol) is a peer-to-peer communication protocol allowing state sharing in distributed systems. It is a decentralized, scalable, and fault-tolerant protocol that can be used to disseminate information
System Design On Design by Contract Design by Contract (DBC) is a mindset to design software using Contract. It has several benefits: better maintainability: easier to read and understand code. easier to review code. easier to write unit tests.
Algorithm Quick note on Count-Min Sketch Problem Count the number of times elements appear in a stream of data. This can be solved easily by using a HashMap. However, data streaming is unbounded so we may end up out
System Design Cache is evil !!! (Part 2) Cache invalidation problems Let's retake a look at the write path of the Look-Aside pattern: clear the cache for key k after updating the database. Easy as cake. Not really ... When your app
System Design Cache is evil !!! (Part 1) Cache is considered a great mechanism to increase performance in system design. However, it often comes with many critical problems such as inconsistency, the validity of data, cache delay... To make things worse,
Algorithm A note on Stream Sync - The protocol behind Dropbox's sync performance Introduction File hosting services like Dropbox/ Google Drive require ability to sync files fast between clients. One of the simple techniques is to break the file into multiple fixed-size blocks so - we
System Design Point-region QuadTree and applications Point-region QuadTree (PR Quadtree) Introduction A rooted tree in which every node has 4 children: each node corresponds to a square in the plane each child of a node corresponds to a quadrant
CS Rate limiter algorithms's consideration High level design of Rate LimiterRequirement Limit the number of requests a user can send to an API within a time window: n requests/minute. Window size = 1 minute. The APIs are accessible