Home
Jacob Lin
Cancel

B+ tree as database index

What is a database index Index is a data structure to improve the speed of queries. Every book has its table of contents. Similarly, an index is the “table of contents” for a database table. ...

Proxy design pattern and RPC framework

The proxy pattern is a structural design pattern that allows you to provide a substitute for an object or its placeholder. Proxies control access to the original object and allow some processing...

Chain of responsibility design pattern

The chain of responsibility design pattern In compiler backend development, we usually will have to run multiple passes on the intermediate representation. Those passes including optimization ...

Decorator design pattern and Java I/O package

The decorator pattern is a way to dynamically add functionality to an instance of an object at runtime. If we want to read data from file with Java, our code will look something like the follo...

How deque is implemented in STL

A double-ended queue is open at both ends compared to the regular queue. Both push and pop operations can be performed at the head and tail of the queue. Essentially, a double-ended queue is just a...

JVM execution engine - interpreter and JIT

Common compiled languages such as C++ usually compile the code directly into machine code that the CPU understands to run. On the other hand, to achieve the “compile once, run everywhere” feature, ...

Pub-Sub design pattern

Pub-Sub design pattern is usually known as Observer pattern. I personally like to refer this pattern as Pub-Sub which I think better captures the essence of this pattern. In GoF’s book Design Patt...

How to design a key-value storage system?

The following are my notes from reading G.K’s system design book Let’s first condier a easier question: how to design a simple key-value storage system on a single machine? Single node key-va...

Simple implementation of a logging framework

Details of an Apache Log4j vulnerability were recently made public, which attackers could exploit to execute code remotely. The matter has caused an extremely heated discussion online and has led t...

Flood-fill algorithm