2B20DIT021 BHASHKAR DHRUVinhey-there.hashnode.dev·Feb 7 · 7 min readChapter 1Let’s just start with a simple system that has the web application and the database present in the same server. Now this is completely fine for a small number of users, but with scale, at some point in time, the resources of the single server will ge...00
2B20DIT021 BHASHKAR DHRUVinhey-there.hashnode.dev·Jan 18 · 3 min readHigh Level System Design v/s Low Level System DesignI'll explain high-level and low-level system design using a URL shortening service (like bit.ly) as our technical example. High-Level System Design (HLD) High-level design focuses on the architecture and major components of the system. It answers "wh...00
2B20DIT021 BHASHKAR DHRUVinhey-there.hashnode.dev·Nov 1, 2025 · 2 min readPattern 5: Channels in Gopackage main import ( "fmt" "time" ) // Worker processes a task and sends result back func worker(id int, task string, resultChan chan string) { fmt.Printf("Worker %d: Starting task '%s'\n", id, task) time.Sleep(2 * time.Second) // ...00
2B20DIT021 BHASHKAR DHRUVinhey-there.hashnode.dev·Nov 1, 2025 · 2 min readPattern 2 Master server making heartbeat requests to the slave servers to check if they are alivepackage main import ( "fmt" "sync" "time" ) type Master struct { slaves []*Slave shutdown bool mu sync.Mutex } type Slave struct { ID string Alive bool } func (m *Master) checkSlaveHealth(slave *Slave) {...00
2B20DIT021 BHASHKAR DHRUVinhey-there.hashnode.dev·Nov 1, 2025 · 2 min readPattern 4: Condition Variables for Waiting on Shared Statepackage main import ( "fmt" "sync" "time" ) type DataStore struct { data []int ready bool mu sync.Mutex cond *sync.Cond } func NewDataStore() *DataStore { ds := &DataStore{ data: make([]int, 0), ...00