Consistent hashing

As the World Wide Web became more popular all of sudden a server could receive way more traffic than it could handle causing the server to service requests slowly or to not be able to serve them at all1. An intuitive solution to this problem is to cache2 the content served by the servers and allow the clients to fetch content from the caches instead of going to the original server. Several clients communicate with the same cache servers which means that if client 1 fetches the contents for the page example.com, client 2 can fetch the same contents from the cache instead of going to the oirignal server if it decides to visit example.com as well. ...

October 6, 2023 · 6 min · poorlydefinedbehaviour

Reading list September 2023

The list of things I read or watched this month Farewell EC2-Classic, it’s been swell - https://www.allthingsdistributed.com/2023/09/farewell-ec2-classic.html Building a Firecracker-Powered Course Platform To Learn Docker and Kubernetes - https://iximiuz.com/en/posts/iximiuz-labs-story/ The Power Of Struct Embedding And Interfaces In Golang - https://www.youtube.com/watch?v=fXZJu_JuH0A Beginners Should Think Differently When Writing Golang - https://www.youtube.com/watch?v=PyDMqgOkiR8 How to Get Transactions Between (Almost) Any Data Stores - https://petereliaskraft.net/blog/epoxy How to do Distributed Transactions the RIGHT way? Microservices - https://www.youtube.com/watch?v=vGOEO6mO674 “Workflows, a new abstraction for distributed systems” by Dominik Tornow (Strange Loop 2022) - https://www.youtube.com/watch?v=V_5WeVmyhzg Domain Modeling Gone Wrong - Part 2 - https://www.youtube.com/watch?v=2Tvb1fA3PLQ dbdb: etcd - https://dbdb.io/db/etcd Shuffle Sharding: Massive and Magical Fault Isolation - https://aws.amazon.com/blogs/architecture/shuffle-sharding-massive-and-magical-fault-isolation/ System Design: Apache Kafka In 3 Minutes - https://www.youtube.com/watch?v=HZklgPkboro Serializability - https://jepsen.io/consistency/models/serializable Strict Serializability - https://jepsen.io/consistency/models/strict-serializable Linearizability - https://jepsen.io/consistency/models/linearizable What is Linearizability in Distributed System? - https://hongilkwon.medium.com/what-is-linearizability-in-distributed-system-db8bca3d432d Towards Inserting One Billion Rows in SQLite Under A Minute - https://avi.im/blag/2021/fast-sqlite-inserts/ You Cannot Have Exactly-Once Delivery - https://bravenewgeek.com/you-cannot-have-exactly-once-delivery/ Pagination in MySQL - https://www.youtube.com/watch?v=zwDIN04lIpc Free your API. Misconceptions are holding you back! - https://www.youtube.com/watch?v=nS8XHgMvqNo Understanding Consensus - https://bravenewgeek.com/understanding-consensus/ Algorithms You Should Know Before System Design Interviews - https://www.youtube.com/watch?v=xbgzl2maQUU Distributed consensus - https://shachaf.net/w/consensus are “smart pointers” actually smart? - https://www.youtube.com/watch?v=tSIBKys2eBQ There is plenty of room at the bottom - https://muratbuffalo.blogspot.com/2021/08/there-is-plenty-of-room-at-bottom.html Raft does not Guarantee Liveness in the face of Network Faults - https://decentralizedthoughts.github.io/2020-12-12-raft-liveness-full-omission/ What is Zig’s “Colorblind” Async/Await? - https://kristoff.it/blog/zig-colorblind-async-await/ A Gentle Introduction to LLVM IR - https://mcyoung.xyz/2023/08/01/llvm-ir/ Single-Decree Paxos - https://mwhittaker.github.io/blog/single_decree_paxos/ I Wrote A String Type - https://mcyoung.xyz/2023/08/09/yarns/ Little Computer 3 - https://en.wikipedia.org/wiki/Little_Computer_3 LC3 Instruction Set Architecture - https://winniewjeng.github.io/organization%20&%20programming/2020/06/09/Instruction-Set-Architecture/ LC3 Machine Instruction - https://winniewjeng.github.io/organization%20&%20programming/2020/06/08/LC3-Machine-Instruction/ What is a spinlock? //Source Dive// 002 - https://www.youtube.com/watch?v=ZE9OODanrDA Sign extension - https://en.wikipedia.org/wiki/Sign_extension Use your database to power state machines - https://blog.lawrencejones.dev/state-machines/ ZooKeeper: Zab vs. Paxos - https://cwiki.apache.org/confluence/display/ZOOKEEPER/Zab+vs.+Paxos University of Washington: Replicated State Machines Primary-Backup - https://courses.cs.washington.edu/courses/cse552/19au/notes/lect3.pdf Princeton: Replication State Machines via Primary-Backup Replication - https://www.cs.princeton.edu/courses/archive/spring22/cos418/docs/L11-rsm-pb.pdf MIT 6.824: Lecture 4: Primary-Backup Replication - https://www.youtube.com/watch?v=M_teob23ZzY Large Language Models from scratch - https://www.youtube.com/watch?v=lnA9DMvHtfI Large Language Models: Part 2 - https://www.youtube.com/watch?v=YDiSFS-yHwk Searching by location in MySQL - https://www.youtube.com/watch?v=QgnCB8X_sN4 why do header files even exist? - https://www.youtube.com/watch?v=tOQZlD-0Scc Alternative to the Outbox Pattern? Not so fast. - https://www.youtube.com/watch?v=cuQ9zuNF1cI Container Loading in AWS Lambda - https://brooker.co.za/blog/2023/05/23/snapshot-loading.html JDK 21 LTS - All Features Explained! - https://www.youtube.com/watch?v=bgxuSIhkQZg 4x shorter WebGPU access from Wasm, featuring Nelua, Zig, & Rust - https://www.youtube.com/watch?v=I-tN3dS2zwA Fixing For Loops in Go 1.22 - https://go.dev/blog/loopvar-preview Another way to check pointers at runtime in C - https://www.youtube.com/watch?v=xCxI2GIFdZo RabbitMQ vs. Kafka – An Architect’s Dilemma (Part 1) - https://eranstiller.com/rabbitmq-vs-kafka-an-architects-dilemma-part-1 RabbitMQ vs. Kafka – An Architect’s Dilemma (Part 2) - https://eranstiller.com/rabbitmq-vs-kafka-an-architects-dilemma-part-2 295 - LOCK otimista no CASO DE USO | theWiseDev CleanArch - https://www.youtube.com/watch?v=e6cxVjv5rN0 Transactions: Write skew & why we need serialization? - https://distributed-computing-musings.com/2022/02/transactions-write-skew-why-we-need-serialization/ Transactions: Introduction to serializability techniques - https://distributed-computing-musings.com/2022/02/transactions-introduction-to-serializability-techniques/ Transactions: Two-phase Locking - https://distributed-computing-musings.com/2022/02/transactions-two-phase-locking/ Transactions: Serializable Snapshot Isolation - https://distributed-computing-musings.com/2022/02/transactions-serializable-snapshot-isolation/ Best Developer Interview Question - https://www.youtube.com/watch?v=h1w4X3CmRH4 How to create an alert rule in Grafana 10.1 - https://www.youtube.com/watch?v=nPdzomH6bno New flame graph features for continuous profiling data in Grafana 10.1 - https://www.youtube.com/watch?v=bezFLhbzDOM How to to filter trace spans in Grafana 10.1 - https://www.youtube.com/watch?v=VP2XV3IIc80 Grafana 10.1: TraceQL query results streaming - https://www.youtube.com/watch?v=7BRapaDM_2c Understand Paxos with Rust, Automerge, and TLA+ — Part 1: The Synod. - https://medium.com/@polyglot_factotum/understand-paxos-with-rust-automerge-and-tla-part-1-the-synod-371df5f16f45 Loki Log Context Query Editor in Grafana 10 - https://www.youtube.com/watch?v=t6SG-w_bVss What is Podman? How is it Different Than Docker? - https://www.youtube.com/watch?v=5WML8gX2F1c Relational Databases vs Time Series Databases - https://www.influxdata.com/blog/relational-databases-vs-time-series-databases/ Linux network ring buffers - https://medium.com/coccoc-engineering-blog/linux-network-ring-buffers-cea7ead0b8e8 How do databases execute expressions? - https://notes.eatonphil.com/2023-09-21-how-do-databases-execute-expressions.html Rustonomicon: Poisoning - https://doc.rust-lang.org/nomicon/poisoning.html Make Kubernetes and Platform Engineering Easier Part 2 Monitoring and Observability - https://www.youtube.com/watch?v=RjtT1Q7DpmQ Make Kubernetes and Platform Engineering Easier Part 4: Application Workflows - https://www.youtube.com/watch?v=YPuAAS3lba8 ORMs can lead to FAT domain models. Slim them down! - https://www.youtube.com/watch?v=4UZXUc9jmHc Adding Nested Loops Makes this Algorithm 120x FASTER? - https://www.youtube.com/watch?v=QGYvbsHDPxo Mark Zuckerberg: First Interview in the Metaverse | Lex Fridman Podcast #398 - https://www.youtube.com/watch?v=MVYrJJNdrEg Faster database indexes (straight from the docs) - https://www.youtube.com/watch?v=5aezDBaNfcc Containerization Strategy - https://www.youtube.com/watch?v=iLyBEEkm5e0 why do void pointers even exist? - https://www.youtube.com/watch?v=t7CUti_7d7c The Pros and Cons of Encrypted Client Hello - https://www.youtube.com/watch?v=1ezrBsJCVqw Why Do You Only Get Motivated After Midnight? | Night Owls - https://www.youtube.com/watch?v=jiIhOgpOWcA Why You Should Be Ashamed Of Yourself - https://www.youtube.com/watch?v=COHThDr1uvg Server Name Indication (SNI) TLS Extension Explained - https://www.youtube.com/watch?v=manTiXESYG0 50 years later, is Two-Phase Locking the best we can do? - concurrencyfreaks.blogspot.com/2023/09/50-years-later-is-two-phase-locking.html

October 1, 2023 · 4 min · poorlydefinedbehaviour

Reading list August 2023

The list of things I read or watched this month Aplicação do Open Closed Principle: Exemplo prático com metaprogramação mais polimorfismo - https://www.youtube.com/watch?v=-gOR0WXZmYg Firecracker: Lightweight Virtualization for Serverless Applications - https://www.usenix.org/system/files/nsdi20-paper-agache.pdf SEC02-BP02 Use temporary credentials - https://docs.aws.amazon.com/wellarchitected/latest/framework/sec_identities_unique.html 5 Tips for Building Resilient Architecture - https://www.youtube.com/watch?v=gm6Y4vPlOLg Containers at the edge: it’s not what you think, or maybe it is - https://blog.cloudflare.com/containers-on-the-edge/ What is a Point of Presence (PoP) in networking? - https://rahi.io/articles/what-is-a-point-of-presence-pop-in-networking/ A Programmer-Friendly I/O Abstraction Over io_uring and kqueue - https://tigerbeetle.com/blog/a-friendly-abstraction-over-iouring-and-kqueue/ Intrusive linked lists - https://www.data-structures-in-practice.com/intrusive-linked-lists/ Case Study: TigerBeetle Simulator (VOPR) - https://github.com/LAC-Tech/laterbase/blob/master/deterministic_simulation_testing.md Dependency Injection, The Best Pattern - https://www.youtube.com/watch?v=J1f5b4vcxCQ How to Add AI to Your Apps Faster with Embedded AI - https://www.youtube.com/watch?v=OThahaOga20 Why Google and Meta Put Billion Lines of Code In 1 Repository? - https://www.youtube.com/watch?v=x3cANGNPyx0 Cybersecurity Architecture: Response - https://www.youtube.com/watch?v=Jk79QJCxPkM What happens before the Backend gets the Request - https://www.youtube.com/watch?v=gSQoA4SYhJY Torturing Postgres: extreme autonomous testing for distributed architectures - https://medium.com/@thinkx_/torturing-postgres-extreme-autonomous-testing-for-distributed-architectures-e1c4139ed72e FoundationDB or: How I Learned to Stop Worrying and Trust the Database (Markus Pilman, Snowflake) - https://www.youtube.com/watch?v=OJb8A6h9jQQ Autonomous Testing and the Future of Software Development - Will Wilson - https://www.youtube.com/watch?v=fFSPwJFXVlw How does the Kernel manage backend Connections? - https://www.youtube.com/watch?v=Mc7hAjgFBvY Let’s implement a basic leader election algorithm using Go with RPC - https://itnext.io/lets-implement-a-basic-leader-election-algorithm-using-go-with-rpc-6cd012515358 Pattern: 3rd Party Registration - https://microservices.io/patterns/3rd-party-registration.html Let’s implement basic service discovery using Go - https://itnext.io/lets-implement-basic-service-discovery-using-go-d91c513883f6 Most Common Kubernetes Deployment Strategies (Examples & Code) - https://www.youtube.com/watch?v=lxc4EXZOOvE As HashiCorp adopts the BSL, an era of open-source software might be ending - https://www.runtime.news/as-hashicorp-adopts-the-bsl-an-era-of-open-source-software-might-be-ending/ Configure Grafana private data source connect - https://grafana.com/docs/grafana-cloud/connect-externally-hosted/configure-private-datasource-connect/ Circuit-level gateway - https://en.wikipedia.org/wiki/Circuit-level_gateway Dynamic Reverse Tunnels in SSH - https://blog.benpri.me/blog/2019/05/25/dynamic-reverse-tunnels-in-ssh/ SOCKS5 Proxies Explained - https://www.youtube.com/watch?v=EfOjTkFR1iw Git MERGE vs REBASE: Everything You Need to Know - https://www.youtube.com/watch?v=0chZFIZLR_0 Database Replication Explained (in 5 Minutes) - https://www.youtube.com/watch?v=bI8Ry6GhMSE Database Replication Explained - https://towardsdatascience.com/database-replication-explained-5c76a200d8f3 Fundamentals of Neural Networks - https://wandb.ai/site/articles/fundamentals-of-neural-networks Gradient Descent: All You Need to Know - https://hackernoon.com/gradient-descent-aynk-7cbe95a778da Apriori — Association Rule Mining In-depth Explanation and Python Implementation - https://towardsdatascience.com/apriori-association-rule-mining-explanation-and-python-implementation-290b42afdfc6 is it wrong to use numbers in your code? (low level code review) - https://www.youtube.com/watch?v=cjarxeW9_Wo Storing money in MySQL (the right way) - https://www.youtube.com/watch?v=fhwEFZ34c7g SOCKS - https://en.wikipedia.org/wiki/SOCKS SOCKS 5 — A Proxy Protocol - https://medium.com/@nimit95/socks-5-a-proxy-protocol-b741d3bec66c Backward Compatibility, Go 1.21, and Go 2 - https://go.dev/blog/compat Containers at the Edge - https://www.youtube.com/watch?v=LBx56Q10G3Q How a startup loses its spark - https://blog.johnqian.com/startup-spark The Bitter Lesson - www.incompleteideas.net/IncIdeas/BitterLesson.html Kubernetes and Platform Engineering Part 1: k8s Operators - https://www.youtube.com/watch?v=1i9C-QWQUE8 294 - Concorrência na CLEAN ARCHITECTURE | theWiseDev NFR - https://www.youtube.com/watch?v=QEJUAInPKjw Your CPU May be FASTER than You Think - https://www.youtube.com/watch?v=WgTr79htuM4 A Real World Project Use Case Of Golang’s Sync.WaitGroup - https://www.youtube.com/watch?v=96scGqEV0pc Why we use the Linux kernel’s TCP stack - https://blog.cloudflare.com/why-we-use-the-linux-kernels-tcp-stack/ Cloud Computing without Containers - https://blog.cloudflare.com/cloud-computing-without-containers/ Career advice for young system programmers - https://glaubercosta-11125.medium.com/career-advice-for-young-system-programmers-c7443f2d3edf Distributed Transactions at Scale in Amazon DynamoDB - https://muratbuffalo.blogspot.com/2023/08/distributed-transactions-at-scale-in.html DynamoDB’s Best Feature: Predictability - https://brooker.co.za/blog/2022/01/19/predictability.html Why do we use the Linux kernel’s TCP stack? - jvns.ca/blog/2016/06/30/why-do-we-use-the-linux-kernels-tcp-stack/ Top 6 Load Balancing Algorithms Every Developer Should Know - https://www.youtube.com/watch?v=dBmxNsS3BGE Understanding Transaction Isolation in DynamoDB: From Concepts to Conflicts - https://blog.calvinsd.in/understanding-transaction-isolation-in-dynamodb Timestamp-based Algorithms for Concurrency Control in Distributed Database Systems - https://muratbuffalo.blogspot.com/2022/11/timestamp-based-algorithms-for.html Fantastic Learning Resources - https://matklad.github.io/2023/08/06/fantastic-learning-resources.html CONSENSUS: BRIDGING THEORY AND PRACTICE - https://web.stanford.edu/~ouster/cgi-bin/papers/OngaroPhD.pdf Viewstamped Replication Made Famous - Joran Greef - https://www.youtube.com/watch?v=qeWyc8G-lq4 Revisiting Viewstamped Replication with Brian Oki and James Cowling - https://www.youtube.com/watch?v=ps106zjmjhw How To Identify File Types - File Format Analysis Tools - https://www.youtube.com/watch?v=xwpNYpFRLf0 Kubernetes Canary Deployment (Manual vs Automated) - https://www.youtube.com/watch?v=fWe6k4MmeSg What is gained and lost with 63-bit integers? - https://blog.janestreet.com/what-is-gained-and-lost-with-63-bit-integers/ What Rust Discovered - https://www.youtube.com/watch?v=v6RxJsk8otY Starting my own hobby language (again) - https://www.youtube.com/watch?v=2bvltIjqrRg The Dark Side of .reserve() - https://www.youtube.com/watch?v=algDLvbl1YY Stop using COUNT(id) to count rows - https://www.youtube.com/watch?v=H6juZ8c_Nu8 Tooling for Tooling - https://uptointerpretation.com/posts/tooling-for-tooling/ Solutions Architect Interview - How Do CDNs Work? (with Salesforce SA) - https://www.youtube.com/watch?v=j9KT9geE5SU Your CPU May be FASTER than You Think - https://www.youtube.com/watch?v=WgTr79htuM4 Kubernetes and Platform Engineering Part 2: Cluster API - https://www.youtube.com/watch?v=K1fGoWCoeSs Data Consistency Between Microservices - https://www.youtube.com/watch?v=uKURpE12Mgo Viewstamped Replication explained - https://blog.brunobonacci.com/2018/07/15/viewstamped-replication-explained/ A Proxy Protocol - https://medium.com/@nimit95/socks-5-a-proxy-protocol-b741d3bec66c So Long, Twitter and Reddit - https://andrewkelley.me/post/goodbye-twitter-reddit.html Getting into formal specification, and getting my team into it too - https://brooker.co.za/blog/2022/07/29/getting-into-tla.html Simple Simulations for System Builders - https://brooker.co.za/blog/2022/04/11/simulation.html Stateful Property Testing in Rust - https://blog.readyset.io/stateful-property-testing-in-rust Exactly-Once Semantics Are Possible: Here’s How Kafka Does It - https://www.confluent.io/blog/exactly-once-semantics-are-possible-heres-how-apache-kafka-does-it/ Viewstamped Replication: The Less-Famous Consensus Protocol - https://brooker.co.za/blog/2014/05/19/vr.html Everything You Always Wanted To Know About fsync() - https://blog.httrack.com/blog/2013/11/15/everything-you-always-wanted-to-know-about-fsync/ Why we built Restate - https://www.restate.dev/blog/why-we-built-restate/ EC2 Enhanced Networking Tutorial - https://www.youtube.com/watch?v=DsNEtIS_q_E Top 5 Most Used Architecture Patterns - https://www.youtube.com/watch?v=f6zXyq4VPP8 Want to build a good API? Here’s 5 Tips for API Design. - https://www.youtube.com/watch?v=HBH6qnj0trU 5 Strong Opinions On Everyday Rust - https://www.youtube.com/watch?v=8j_FbjiowvE Durable Objects: Easy, Fast, Correct — Choose three - https://blog.cloudflare.com/durable-objects-easy-fast-correct-choose-three/ Serverless Workflows with Durable Functions and Netherite - https://arxiv.org/pdf/2103.00033.pdf “Formal Modeling and Analysis of Distributed Systems” by Ankush Desai (Strange Loop 2022) - https://www.youtube.com/watch?v=5YjsSDDWFDY The Time Traveler’s Guide to Distributed Applications - https://qianli.dev/blog/timetravel Kubernetes and Platform Engineering Part 3: Crossplane - https://www.youtube.com/watch?v=CPjAiYSoBRE Emulation Fundamentals - Writing A Basic x86 Emulator - https://www.youtube.com/watch?v=HPrqOIdNlrQ

September 1, 2023 · 4 min · poorlydefinedbehaviour

Notes on formal languages: alphabets, strings and languages

An alphabet is any set of finite symbols such as a and b. For example, the alphabet Σ = {a, b} is an alphabet that contains the strings that can be built by combining a and b and the alphabet Σ = {0, 1} is the an alphabet that contains the strings that can be built by combining 0 and 1. Symbols such as a and b put together to form something like bbaa are called strings. ...

August 8, 2023 · 1 min · poorlydefinedbehaviour

How I write CI pipelines in 2023

Dagger is a programmable CI/CD engine that runs your pipelines inside containers1 which makes it easier to test things locally and to setup complex workflows. Not having to write yaml/bash/etc as the workflow gets more complex is a huge advantage for me. I’m working on a personal project that will allow people to deploy their code by selecting a GitHub repository. Me and a friend have decided to use Dagger to clone the user provided Git repository and build a Docker image and it was extremely easy to get it working. ...

August 5, 2023 · 2 min · poorlydefinedbehaviour