Skip to content

More Projects

Patterns from databases, JVM ecosystem, browsers, and other notable open-source projects.

Databases & Storage

PatternProjectWhereWhat It Does
MVCCPostgreSQLheapam_visibility.cHeapTupleSatisfiesMVCC — snapshot isolation visibility check
Write-Ahead LogPostgreSQLxlog.cTransaction WAL for crash recovery, replication, PITR
MVCCetcdkvstore.goMulti-version KV store powering Kubernetes config
Write-Ahead Logetcdwal.goRaft consensus WAL for distributed state
LRU CacheRedisevict.cApproximated LRU with sampling-based eviction pool
TrieRedisrax.c / rax.hRAX radix tree for Streams and sorted key ranges
Skip ListRedist_zset.cSorted set implementation with probabilistic balancing
Bloom FilterLevelDBbloom.ccBlock-level bloom filter to skip unnecessary disk reads
Skip ListLevelDBskiplist.hLock-free memtable with atomic next pointers
Arena AllocatorLevelDBarena.ccBlock-based arena for memtable allocations
Merge IteratorLevelDBmerger.ccMergingIterator merges sorted iterators (memtable + SSTable levels) into single sorted view
LSM TreeLevelDBdb_impl.ccDBImpl::Write — batch writes to WAL, insert into memtable, flush to SST on threshold
Merge IteratorRocksDBmerge_helper.ccTimedFullMerge combines multiple versions of the same key during compaction
LSM TreeRocksDBmemtable.ccMemTable::Add — skip-list backed memtable, flush to L0 SST when full
B+ TreePostgreSQLnbtinsert.cB-link tree (Lehman-Yao variant) — all tables and indexes backed by B+ trees on disk pages
B+ TreeSQLitebtreeInt.hInterior cells hold child page pointers + keys; leaf cells hold payloads. Page splitting via balance_nonroot()
Merkle TreeZFS (OpenZFS)blkptr.cBlock pointer checksums form a Merkle tree from data blocks to uberblock for silent corruption detection
CheckpointingPostgreSQLcheckpointer.cCheckpointerMain — flush dirty buffers, write checkpoint WAL record, update pg_control
CheckpointingRedisrdb.crdbSaveRio — fork child process to write point-in-time RDB snapshot without blocking main thread

JVM Ecosystem

PatternProjectWhereWhat It Does
Actor ModelAkkaActor.scalatrait Actor — message-driven concurrency for JVM
Circuit BreakerNetflix HystrixHystrixCircuitBreaker.javaThree-state circuit breaker for microservice resilience
Batch ProcessingApache KafkaRecordAccumulator.javaAccumulate records into batches per partition
Work StealingOpenJDKForkJoinPool.javascan method with randomized work stealing
LRU CacheGuavaCacheBuildermaximumSize() with LRU eviction
Rate LimiterGuavaRateLimiterSmooth bursty / warm-up token bucket
Consistent Hashinggroupcacheconsistenthash.goHash ring with virtual replicas (by Brad Fitzpatrick)

Erlang / BEAM VM

PatternProjectWhereWhat It Does
Actor ModelErlang/OTPerl_process.hBEAM VM process struct — lightweight actor with mailbox
Cooperative SchedulingErlang/OTPBEAM schedulerReduction-based preemption for millions of processes
SemaphoreErlang/OTPerl_process_lock.cProcess locks for safe concurrent access

Browsers & Web

PatternProjectWhereWhat It Does
Bloom FilterChromiumselector_filter.hCSS selector bloom filter — skip 60-70% of rules
BitmaskReactReactFiberFlags.jsFiber effect flags — Placement, Update, Deletion
Double BufferingReactFiber architectureCurrent tree vs work-in-progress tree swap on commit
Diff / PatchReactReactChildFiber.jsList reconciliation with key-based matching

Infrastructure & Cloud

PatternProjectWhereWhat It Does
Retry BackoffKubernetesbackoff.goPod restart backoff, API server retries
Retry BackoffgRPC-Gointernal/backoff/backoff.goExponential connection backoff with jitter
Dependency GraphTerraformResource graphParallel resource apply with DAG ordering
Dependency GraphBazelAction graphTopological execution of build targets
RegistrygRPC-Goserver.goRegisterService adds service descriptions to the server's service map for RPC method dispatch
RegistryTensorFlowop.hREGISTER_OP macro registers operations into the global OpRegistry for computation graph building
Consistent HashingNginxngx_http_upstream_hashUpstream load balancing with ketama hashing

Compilers & Language Runtimes

PatternProjectWhereWhat It Does
VisitorLLVMInstVisitor.hCRTP visitor dispatches on IR instruction opcode for optimization passes
VisitorVue.jstransforms/vIf.tstransformIf is a NodeTransform visitor that walks the template AST
VtableCPythonobject.hPyTypeObject vtable — tp_repr, tp_hash, tp_call, protocol suites
InterningCPythonunicodeobject.cPyUnicode_InternInPlace — intern identifier strings for O(1) dict lookups
InterningRust (rustc)symbol.rsSymbol is a u32 index into global interner — all identifiers interned
Tagged UnionGodot Enginevariant.hVariant::Type enum + union — every GDScript value is a Variant
Tagged UnionPyTorchivalue.hIValue holds a Tag enum + Payload union for TorchScript interpreter

Further Reading

Released under the MIT License.