RAG in Production, Temporal Primer, Structured Prompt Driven Development and more in Architecture Weekly #197
5 Ways to make CDC with Postgres, What’s Easy, What’s Hard Now, Replacing Redis with MySQL, Valkey 9.1 and Your AI wants to nuke your database.
Architecture Weekly Issue #197. Articles, books, and playlists on architecture and related topics. Split by sections, highlighted with complexity: 🤟 means hardcore, 👷♂️ is technically applicable right away, 🍼 - is an introduction to the topic or an overview. Available in telegram as well.
Software Architecture Weekly is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.
Business Oriented System Design Course
Wanna learn how to design systems which truly impact business and get promoted? Sign up for Business Oriented System Design Course: starts 8th of June. Begin the year with learning crucial skills and advance your career! 100+ engineers from Bolt, Booking.com, Semrush, TripleTen etc. who completed the course and brought their architecture skills to a new level.
Highlights
RAG in Production 👷♂️
We faced the problem of choosing data sources for our AI Agents and obviously we started weighing retriaval augamented generation. And it looks like RAG is surprisingly complex: tokenization process, committing to the model, reindexing cost and many more. Grab a great article on the topic.
#rag #ai
Temporal Primer — Building Long-Running Systems 🍼
Temporal is a durable execution engine that records every workflow event — activity scheduled, timer fired, signal arrived — as an immutable entry in an event history persisted to Cassandra, PostgreSQL, or MySQL, then replays that history on worker restart so a process survives network partitions and VM reboots without any custom state management code. Workflow code must be strictly deterministic (no random values, no wall-clock reads, no direct I/O); all side effects live in Activities, which carry independent retry policies. For agentic systems that chain dozens of tool calls over minutes or hours, this durability model solves exactly the failure class that cron + queue + DB hacks break under.
#distributed #architecture #softwareengineering #llm
Structured prompt driven development 👷♂️
Everybody who hasn’t spent last 2 years in a cave came up with their own way of working in the AI for software development era. Thoughtworks is no exception. Their core idea is prompt should become a first class citizen, just like code: be saved, versioned and reviewed. Based on this idea they develop the structured prompt process and tools and show how to implement a feature with it. To my taste the approach is a bit naive because creating holistic, full and correct test cases is much more complicated than “make me test cases, avoid duplicates” like it is shown in the article, but interest approach anyway.
#softwaredevelopment
Follow-Up
5 Ways to make CDC with Postgres
Short article not only on the CDC blueprint from Pinterest, but also mentioning 5 different ways of how Change Data Capture can be implemented in PostgreSQL. I knew only half of them!
#db #cdc
What’s Easy Now? What’s Hard Now? 👨💼
AI coding agents are fundamentally feedback loops built around LLMs, and the quality of available feedback determines where they succeed or fail. Tasks with fast, clear, objective feedback — like building a UI — are much easier for agents than tasks where feedback is delayed, silent, or subjective: writing concurrent code (where bugs manifest as silent data corruption at runtime), or making architecture decisions (where feedback is inherently contextual and often never arrives). Brooker frames this as the most important axis for evaluating agent capability, whether the problem domain supports tight feedback loops.
#ai #softwareengineering #engineering #llm
We replaced Redis with MySQL for inventory reservations—and it scaled 👨💼
Shopify replaced a Redis-backed inventory reservation system with MySQL by switching from a single quantity-per-item counter to one row per sellable unit, using MySQL 8’s `SKIP LOCKED` to eliminate row-level contention without waiting. The old Redis model had no atomicity across the reserve and claim steps — payment could succeed while inventory went unclaimed — and had no multi-location awareness; the new MySQL design fixes both with ACID guarantees in a single database transaction. A bounded pool capped at 1,000 rows per item/location pair keeps write paths narrow. Under peak Black Friday 2025 traffic ($5.1M in sales per minute), writer CPU stayed under 50% and reader CPU under 16%, with headroom to spare. #db #architecture #softwareengineering engineering
Valkey 9.1 delivers improvements in security, performance, and more 👨💼
Valkey 9.1 cuts per-key memory usage by up to 10% for common workloads — up to 20% for strings under 128 bytes and 10% for sorted sets via skiplist optimizations — with no reconfiguration required. A redesigned I/O threading model improves throughput by up to 17%, and a new database-level ACL system enables fine-grained multi-tenant isolation within a single instance. The headline addition is Valkey Search 1.2, which folds full-text search, tag filtering, numeric lookup, and AI-native vector search directly into the same system as the cache — eliminating the need to run a separate search platform alongside it.
#db #distributed #softwareengineering #cloud
Your AI wants to nuke your database 👷♂️
AI deleting your production database is not a nightmare anymore: it’s a reality which happened to PocketOS running their systems on Railway. To be fair to the latter company, they learned from the incident and implemented 48 hour window for soft deletion and backups for backups. Learn the full story in the article.
#ai #resilience
Big thanks to Nikita, Constantin, Anatoly, Oleksandr, Dima, Pavel B, Pavel, Robert, Roman, Iyri, Andrey, Lidia, Vladimir, August, Roman, Egor, Roman, Evgeniy, Nadia, Daria, Dzmitry, Mikhail, Nikita, Dmytro, Denis and Mikhail for supporting the newsletter on Patreon! Alternatively, you can upgrade to the paid version and get access to the premium only posts!





