PostgreSQL Query Rewriting Techniques The previous articles in this series covered performance problems you fix by adding indexes, restructuring joins, or tuning memory. This one is about the queries where the plan is "fine" — every node is doing something reasonable — but the query itself is asking the wrong question, producing unnecessarily large intermediate results or forcing the planner dow
“We have failover.” That sounds reassuring. But when real failure hits… many systems still go down — hard. Why? Because failover is easy to configure — but extremely hard to make reliable at global scale. Here are the most common ways failover fails in production: RDS Multi-AZ enabled Kubernetes failover configured Looks good on paper. Reality: Takes minutes instead of seconds Gets stuc
SOFTWARE ARCHITECTURE & REFACTORING 3 Domain-Centric Architectures Every Software Architect Should Know The first concern of the architect is to make sure that the house is usable; it is not to ensure that the house is made of brick. — Uncle Bob The expression domain is occurring in software bibles for a very long time now and is heavily discussed in the book Domain-Driven
How we moved from a fragile loop-based payout system to a reliable, idempotent, and traceable architecture. On paper, payouts sound simple: Customer places an order Platform collects payment Platform pays the seller That's it. Until you try to do it at scale. In any marketplace or fintech system, money flows across multiple parties: Sellers / vendors Delivery partners Platform fees Discounts, vouc
This section is the map for the rest of the book. The five stages introduced in the 1.1 chapter overview (parse, analyze/rewrite, plan, portal, execute) are traced here through the actual code: which functions implement each stage, and in what order they get called. The mechanics of each of the five stages are unpacked in later chapters. Here, only the skeleton matters: how a backend starts up, ho
Is your website throwing 502 errors whenever an external API starts lagging? It is a common engineering grind where slow dependencies choke your server and kill your response times. The fix is not adding more resources. It is about changing how you handle work. Stop making users wait for external processes to finish. Offload heavy tasks to background jobs and queues. Distinguish between workers
PostgreSQL Internals · Chapter 1 Query Processing Suppose a client sends SELECT * FROM users WHERE id = 1. The path that single line travels before coming back as a result row is longer than you might expect. Inside the PostgreSQL backend, that SQL goes through a five-stage pipeline. Backend entry and dispatch. The backend receives the message from the client and decides which processing path it s
In modern data-driven organizations, managing and analyzing data efficiently is critical. OLAP (Online Analytical Processing) and OLTP (Online Transaction Processing) are both integral parts of data management, but they have different functionalities. Understanding how they differ, and how they complement each other is essential for anyone working with data systems. Online Transaction Processing (