docs: add diagrams for lazy loading, leader election, leader followers, lockable object

This commit is contained in:
Ilkka Seppälä committed 2025-04-06 21:22:32 +03:00
1 parent d8b07ac484
commit 72eeb167c5
8 files changed
+16 -8

No files matched your search

+4
View File
@@ -29,6 +29,10 @@ In plain words
> Select one server in the cluster as a leader. The leader is responsible for taking decisions on behalf of the entire cluster and propagating the decisions to all the other servers.
Sequence diagram
![Leader-Followers Sequence Diagram](./etc/leader-followers-sequence-diagram.png)
## Programmatic Example of Leader-Followers Pattern in Java
The Leader-Followers pattern is a concurrency design pattern where one thread (the leader) waits for work to arrive, de-multiplexes, dispatches, and processes the work, thereby enhancing CPU cache affinity and reducing event dispatching latency. Once the leader finishes processing the work, it promotes one of the follower threads to be the new leader. This pattern is useful for enhancing CPU cache affinity, minimizing locking overhead, and reducing event dispatching latency.
Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB