Posts · Page 8

11 min read

Implement a Distributed Cache in Go - GeeCache Day 2 Single-Node Concurrent Cache

7 Days Go Distributed Cache Tutorial Series from scratch (7 days implement golang distributed cache from scratch tutorial). Build a distributed cache by hand, modeled after the implementation of groupcache. This article introduces the use of the sync.Mutex mutual exclusion lock to control concurrency for the LRU cache. It implements GeeCache's core data structure Group; when the cache misses, a callback function is invoked to fetch the source data.

8 min read

Implement a Distributed Cache in Go - GeeCache Day 1 LRU Cache Eviction Strategy

7 Days Go Distributed Cache Tutorial Series from scratch (7 days implement golang distributed cache from scratch tutorial). Build a distributed cache by hand, modeled after the implementation of groupcache. This article introduces the three most common cache eviction (expiry) algorithms: First In First Out (FIFO), Least Frequently Used (LFU), and Least Recently Used (LRU), and implements the LRU algorithm along with the corresponding test code.

11 min read

Go Test: Unit Testing in Go

How to write unit tests in Go with the standard library testing package: subtests, table-driven tests, helper functions, setup and teardown, network/HTTP testing and benchmarks.

4 min read

Implement a Distributed Cache in Go from Scratch - GeeCache

7 Days Go Distributed Cache Tutorial Series from scratch (7 days implement golang distributed cache from scratch tutorial). Build a distributed cache by hand, modeled after the implementation of groupcache. Features include single-node/distributed caching, LRU (Least Recently Used) cache eviction strategy, preventing cache breakdown, consistent hashing (Consistent Hash), protobuf-based communication, and more.

9 min read

A Quick Guide to Go WebAssembly (Wasm)

Front-end development with Go, WebAssembly and GopherJS: registering functions, interacting with browser JavaScript objects, manipulating DOM elements, asynchronous programming with callbacks, plus more advanced demos (games, rendering) and related projects and documentation.

9 min read

A Quick Guide to Go RPC & TLS

Remote Procedure Call (RPC) in Go with the standard library net/rpc: synchronous and asynchronous calls, plus one-way and mutual authentication between server and client using TLS/SSL.