ruby-on-rails
ruby-on-rails
architecture
Messaging problems and solutions you should know before going to production
Messaging looks clean on a diagram and gets messy in production. Duplicate messages, slow consumers, fat events, DLQs used as trash cans: what each problem really costs and the patterns (idempotency, event design, async UX) that keep a broker-based system honest.
fail2ban
How to configure Fail2ban
Fail2ban turns brute-force noise on SSH and your reverse proxy into a boring automated reaction. A practical setup for a VPS or homelab: sane jail config, testing before trusting, notifications without a siren, and where it fits in the wider security story.
Latest
What is the DORA framework and how can it help your company
DORA metrics explained for engineering leaders: deployment frequency, lead time, change failure rate, time to restore and reliability. What each one really tells you, how to use them to improve delivery, and the anti-patterns that turn them into dashboard theater.
21 engineering lessons for real teams
21 engineering lessons that survive contact with production: why simple code beats clever code, technical debt as a communication problem, what actually builds trust in teams, and how senior engineers pick problems. Field notes for real teams, not conference slides.
HTTP caching for engineers who forgot the sharp edges
HTTP caching refresher for engineers: how freshness, revalidation, Vary and Cache-Control really interact, why stale responses can still be useful, what reload actually does, and the boring headers that keep private content out of shared caches.
Rails view rendering performance: when render gets expensive
Rails partials feel free until a page renders hundreds of them. Benchmarks of five rendering strategies (inline ERB, partial loops, collection rendering and more) show which is fastest, why the helper trick backfires, and a practical rule for when to optimize views.
UUIDv7 from PostgreSQL 18 in practice
UUIDv7 arrives in PostgreSQL 18 as a built-in uuidv7() function. See what it changes in practice: friendlier indexes than UUIDv4, simpler Rails migrations, a schema example, and the security caveat that time-ordered does not mean secret.
How to audit a legacy Rails codebase without getting lost
Auditing a legacy Rails codebase starts with one question: what is the team afraid to change? A practical method for finding real hotspots, building a small audit ledger, using tools and AI without drowning in output, and delivering one page that people act on.
How to scale software like Elon Musk: delete first, automate last
Delete first, automate last: Elon Musk's five-step algorithm applied to software. Why questioning requirements and deleting code must come before optimization, and how automating a broken process just gives you a faster version of the wrong machine.
Getting structured input and output from Ollama
Structured output from Ollama takes more than JSON mode. Learn the reliable pattern for a Rails app: shape the input, constrain output with JSON Schema, parse defensively, and retry with feedback so a local LLM survives production instead of just a demo.
Be aware of possible problems with SQLite on Production
SQLite in production works better than its toy reputation, but only if you know the traps: why WAL mode is non-negotiable, how blue-green deployments break your setup, missing ILIKE, quirky JSON types, and what you honestly gain in return.
Your architecture choice is the most important decision you'll make
Architecture is the set of decisions that feel permanent after six months. An honest tour of monolith, layered, modular monolith, SOA, microservices and event-driven options: what each really costs and why the modular monolith deserves more attention than it gets.
How to correctly order messages in distributed systems
Message ordering in distributed systems does not come from a FIFO queue. What actually keeps events sane: idempotency as the real safety net, partition keys when order truly matters, optimistic locking as a version guard, and the traps of multiple consumers.
Cynefin framework - decide when to use Agile vs Waterfall
Cynefin framework in practice for engineers: classify a problem as clear, complicated, complex or chaotic before picking a process, so you know when Agile experiments beat Waterfall plans and what to do when production is down.
Risk management - The illusions of intuition in software engineering
Risk management for engineers, without the vibes: use expected value to judge a rewrite, spot base rate neglect and sunk cost in tech choices, apply Bayesian thinking during outages, and price technical debt with a four-step calculation you can run today.
AI Agents System Architecture - Possible strategies
AI agent architecture comes down to three strategies: single agent, sequential, and parallel. When one big prompt loses the plot, how sequential chains buy reliability, where parallel agents crush latency, and the pitfalls of each before you commit.
Structured logging in Rails 8.1 with Rails.event
Structured logging lands in Rails 8.1 with the Rails.event API. How the Structured Event Reporter replaces regex-parsed log lines with JSON events, plus tags, context, schemas, debug mode, and how to subscribe and test events in your own app.
Ruby 4.0 and the magic of isolation - How Ruby::Box ends the nightmare of monkey patching
Ruby::Box in Ruby 4.0 isolates monkey patches so one gem's core-class override stops breaking the rest of your process. How the isolation works, what problems with global state it ends, and the limitations to weigh before you rely on it.
Forget about technical debt and finally start delivering
Technical debt is not the real enemy: cognitive load is. Why messy abstractions hurt because of what they do to your brain, how the database quietly kills flow, and how to stop chasing code cleanliness for its own sake and start delivering again.
How to serve 800 million users without database sharding?
OpenAI serves over 800 million weekly ChatGPT users without database sharding. Inside the architecture: a single primary PostgreSQL, cascading read replicas, aggressive caching against thundering herds, and connection pooling pushed to its limits.
Snapshot vs Event Sourcing: Why does your system lie about the past?
Snapshot databases only show the current mess, not who knocked over the chair. Event sourcing explained through an investigation lens: anatomy of an event, state recreation as time travel, why audit tables are a dead end, and the honest cost of eventual consistency.
Zanzibar authorisation system by Google
Zanzibar is how Google authorises billions of shared resources across Drive, YouTube and Calendar. A look at its relationship-based data model, the new enemy problem that forces strict consistency, and the Leopard system that keeps checks fast.
Ruby 4.0 and the magic of isolation - How Ruby::Box ends the nightmare of monkey patching
Ruby::Box in Ruby 4.0 isolates monkey patches so one gem's core-class override stops breaking the rest of your process. How the isolation works, what problems with global state it ends, and the limitations to weigh before you rely on it.
When to use Module over Class in Ruby?
Ruby modules often beat classes for service objects: why a shell class like PasswordResetInitiator is procedural code in disguise, using a module as a toolbox, mixins instead of artificial inheritance, and Data objects for tidy parameters.
Ruby 4.0 - a big update for its 30th birthday
Ruby 4.0 marks the language's 30th birthday with maturity instead of revolution: saner syntax for multiline conditions, faster boot with fewer requires, a maturing Ractor story, hidden performance gems, and protection against command injection.
Rails Performance Optimisation - Understanding GVL in practice
Rails performance starts with understanding the GVL: why only one thread runs Ruby code at a time, how that throttles CPU-bound apps, throughput vs latency, choosing a server, offloading to background jobs, and how to instrument and measure before optimising.
From strategy to code: How the discovery process changes thinking about DDD
DDD is not aggregates first: the discovery process is the heart of it. Why strategy with domain experts beats jumping into tactical patterns, the language pitfalls that derail modelling, the 'what if' trap, and why change must come from above and below.
How to add actions after saving in Rails models? A new approach...
after_all_transactions_commit solves a classic Rails race condition: a background job looking for a record that is not committed yet. How the new ActiveRecord callback works inside and outside transaction blocks, and when to reach for it.
Microservices vs Monoliths: breaking free from architectural dogma
Microservices vs monoliths is a trade-off, not a dogma. Why companies really migrate (team coordination, not speed), the complexity bill that follows, what DoorDash's transformation shows, and how to pick architecture on evidence instead of fashion.
How can large files be sent efficiently in Ruby on Rails with authentication and caching?
Sending large files through Rails wastes memory and blocks app workers. X-Sendfile hands the transfer to NGINX while Rails keeps authentication and caching: server configuration, cache headers, testing in development, other HTTP servers, and a complete example.
How to audit a legacy Rails codebase without getting lost
Auditing a legacy Rails codebase starts with one question: what is the team afraid to change? A practical method for finding real hotspots, building a small audit ledger, using tools and AI without drowning in output, and delivering one page that people act on.
Getting structured input and output from Ollama
Structured output from Ollama takes more than JSON mode. Learn the reliable pattern for a Rails app: shape the input, constrain output with JSON Schema, parse defensively, and retry with feedback so a local LLM survives production instead of just a demo.
AI Agents System Architecture - Possible strategies
AI agent architecture comes down to three strategies: single agent, sequential, and parallel. When one big prompt loses the plot, how sequential chains buy reliability, where parallel agents crush latency, and the pitfalls of each before you commit.
Structured logging in Rails 8.1 with Rails.event
Structured logging lands in Rails 8.1 with the Rails.event API. How the Structured Event Reporter replaces regex-parsed log lines with JSON events, plus tags, context, schemas, debug mode, and how to subscribe and test events in your own app.
Ruby 4.0 and the magic of isolation - How Ruby::Box ends the nightmare of monkey patching
Ruby::Box in Ruby 4.0 isolates monkey patches so one gem's core-class override stops breaking the rest of your process. How the isolation works, what problems with global state it ends, and the limitations to weigh before you rely on it.
When to use Module over Class in Ruby?
Ruby modules often beat classes for service objects: why a shell class like PasswordResetInitiator is procedural code in disguise, using a module as a toolbox, mixins instead of artificial inheritance, and Data objects for tidy parameters.
Ruby 4.0 - a big update for its 30th birthday
Ruby 4.0 marks the language's 30th birthday with maturity instead of revolution: saner syntax for multiline conditions, faster boot with fewer requires, a maturing Ractor story, hidden performance gems, and protection against command injection.
Event sourcing vs GDPR, or how to forget in a world that remembers everything
Event sourcing meets GDPR the moment a user asks to be forgotten and your log is append-only. Crypto-shredding is the elegant answer: encrypt personal data per user, delete the key, and design system boundaries so backups and read models forget too.
Safely removing Rails database columns without breaking production
Removing a Rails database column can crash old processes mid-deploy. This walkthrough shows the safe order: ignored_columns first, migration later, plus how to handle columns that still hold data and what the schema cache does behind your back.
HTTP caching for engineers who forgot the sharp edges
HTTP caching refresher for engineers: how freshness, revalidation, Vary and Cache-Control really interact, why stale responses can still be useful, what reload actually does, and the boring headers that keep private content out of shared caches.
Rails view rendering performance: when render gets expensive
Rails partials feel free until a page renders hundreds of them. Benchmarks of five rendering strategies (inline ERB, partial loops, collection rendering and more) show which is fastest, why the helper trick backfires, and a practical rule for when to optimize views.
UUIDv7 from PostgreSQL 18 in practice
UUIDv7 arrives in PostgreSQL 18 as a built-in uuidv7() function. See what it changes in practice: friendlier indexes than UUIDv4, simpler Rails migrations, a schema example, and the security caveat that time-ordered does not mean secret.
How to audit a legacy Rails codebase without getting lost
Auditing a legacy Rails codebase starts with one question: what is the team afraid to change? A practical method for finding real hotspots, building a small audit ledger, using tools and AI without drowning in output, and delivering one page that people act on.
Getting structured input and output from Ollama
Structured output from Ollama takes more than JSON mode. Learn the reliable pattern for a Rails app: shape the input, constrain output with JSON Schema, parse defensively, and retry with feedback so a local LLM survives production instead of just a demo.
Be aware of possible problems with SQLite on Production
SQLite in production works better than its toy reputation, but only if you know the traps: why WAL mode is non-negotiable, how blue-green deployments break your setup, missing ILIKE, quirky JSON types, and what you honestly gain in return.
Structured logging in Rails 8.1 with Rails.event
Structured logging lands in Rails 8.1 with the Rails.event API. How the Structured Event Reporter replaces regex-parsed log lines with JSON events, plus tags, context, schemas, debug mode, and how to subscribe and test events in your own app.
Be aware of possible problems with SQLite on Production
SQLite in production works better than its toy reputation, but only if you know the traps: why WAL mode is non-negotiable, how blue-green deployments break your setup, missing ILIKE, quirky JSON types, and what you honestly gain in return.
Risk management - The illusions of intuition in software engineering
Risk management for engineers, without the vibes: use expected value to judge a rewrite, spot base rate neglect and sunk cost in tech choices, apply Bayesian thinking during outages, and price technical debt with a four-step calculation you can run today.
AI Agents System Architecture - Possible strategies
AI agent architecture comes down to three strategies: single agent, sequential, and parallel. When one big prompt loses the plot, how sequential chains buy reliability, where parallel agents crush latency, and the pitfalls of each before you commit.
Ruby 4.0 and the magic of isolation - How Ruby::Box ends the nightmare of monkey patching
Ruby::Box in Ruby 4.0 isolates monkey patches so one gem's core-class override stops breaking the rest of your process. How the isolation works, what problems with global state it ends, and the limitations to weigh before you rely on it.
Forget about technical debt and finally start delivering
Technical debt is not the real enemy: cognitive load is. Why messy abstractions hurt because of what they do to your brain, how the database quietly kills flow, and how to stop chasing code cleanliness for its own sake and start delivering again.
When to use Module over Class in Ruby?
Ruby modules often beat classes for service objects: why a shell class like PasswordResetInitiator is procedural code in disguise, using a module as a toolbox, mixins instead of artificial inheritance, and Data objects for tidy parameters.
How to modularize a system and avoid 'Siamese twins'
Siamese twin modules force a change in one place to ripple into another. How domain leakage and state-transfer events create a distributed monolith, and how contextual modularization with the right communication patterns cuts the connection, without cargo cult.
What is Architectural Kata and why should every dev try it?
Architectural Kata is a flight simulator for system design: practice big architecture decisions in a safe setting instead of waiting years for a greenfield. How a kata session works, six perspectives that change the outcome, and why architecture is communication.
Your architecture choice is the most important decision you'll make
Architecture is the set of decisions that feel permanent after six months. An honest tour of monolith, layered, modular monolith, SOA, microservices and event-driven options: what each really costs and why the modular monolith deserves more attention than it gets.
AI Agents System Architecture - Possible strategies
AI agent architecture comes down to three strategies: single agent, sequential, and parallel. When one big prompt loses the plot, how sequential chains buy reliability, where parallel agents crush latency, and the pitfalls of each before you commit.
Zanzibar authorisation system by Google
Zanzibar is how Google authorises billions of shared resources across Drive, YouTube and Calendar. A look at its relationship-based data model, the new enemy problem that forces strict consistency, and the Leopard system that keeps checks fast.
When to use Module over Class in Ruby?
Ruby modules often beat classes for service objects: why a shell class like PasswordResetInitiator is procedural code in disguise, using a module as a toolbox, mixins instead of artificial inheritance, and Data objects for tidy parameters.
Event sourcing vs GDPR, or how to forget in a world that remembers everything
Event sourcing meets GDPR the moment a user asks to be forgotten and your log is append-only. Crypto-shredding is the elegant answer: encrypt personal data per user, delete the key, and design system boundaries so backups and read models forget too.
Your system is not unique - The power of business archetypes
Business archetypes prove your 'unique' domain is usually a store selling something unusual. Map complex requirements onto universal building blocks: product catalogue, orders, entitlements, inventory for services, party and billing, and stop reinventing the wheel.
Pseudo-modularity - why your code will fall apart anyway
Pseudo-modularity looks like clean folders and rots underneath: a change in Products breaks Inventory tests and blocks three teams. Why noun-driven modules and a shared database create facade modularity, and what real module boundaries look like.
Party Archetype - Time for architecture that doesn't hurt
Party archetype fixes the 120-column User god object: model people and companies as parties, roles as context instead of identity, and relationships as first-class entities, so a customer who becomes a B2B partner no longer needs an is_partner flag and prayer.