software-architecture
software-architecture
ai
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.
architecture
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.
Latest
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.
CUPID - is SOLID slowly becoming obsolete?
CUPID challenges SOLID with properties instead of rules: composable, Unix philosophy, predictable, idiomatic, domain-based. Where the decades-old principles show their age in the cloud era, what 'joyful software' means, and whether SOLID is really done.
How to control queues and concurrency in Sidekiq?
Sidekiq capsules let you give each queue its own concurrency, so photo processing stops clogging urgent jobs and API calls stay under rate limits. A three-step setup: configure the capsule, assign the job, and call it, with configuration examples.
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.
How can I check the size of the database and tables in PostgreSQL?
PostgreSQL database size checks in a few simple SQL queries: list all databases with pg_database and pg_size_pretty, then break down the biggest tables in a schema, indexes included. Spot what eats disk space before it slows backups and raises infrastructure costs.
How to track and log slow queries in Ruby on Rails applications?
Slow SQL queries in Rails can be caught in development, before they become production fires. Using ActiveSupport::Notifications and the sql.active_record event, you build a small performance guard that logs every query above a time threshold straight to your console.
Deprecation in Rails: How to gracefully remove old code
Deprecation lets you remove old Rails code without breaking teammates' apps overnight. A practical look at ActiveSupport::Deprecation: why sudden deletes hurt, how to warn about methods scheduled for removal, and how to phase out code in a civilized way.
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 find similar records in PostgreSQL with Trigram similarity search in your Ruby on Rails App?
PostgreSQL trigram similarity finds records despite typos: enable pg_trgm, run similarity queries from Rails, tune the threshold, order results by score, and wrap it all in a reusable scope. Great for fuzzy search and duplicate detection without external tools.
How to run Rails console in safe sandbox mode?
Rails console sandbox mode wraps every database operation in a transaction and rolls it all back on exit, so you can experiment safely. How to launch it, plus the traps: database locking, non-rollbackable operations, and why production use still needs care.
Dealing with legacy code that uses different method naming conventions
Legacy services with mismatched method names (validate, execute!, run!) can be unified with Ruby method objects. How to build one dispatcher that calls the right method on each class, why it beats conditionals, and what it does for readability.
Implementing read and write databases in Rails
Rails read and write databases in practice: configure a primary and replica in database.yml, enable automatic connection switching, update ApplicationRecord, and handle the replication challenges that come with splitting the load.
How to create rake task and pass arguments
Creating rake tasks and passing arguments, four ways: the default bracket syntax, OptParse, raw ARGV, and Linux-style flags, plus namespaces and prerequisites for organizing tasks in a Rails app, each with a working example.
When you don't need to use useState in React
Three cases where React's useState is unnecessary: read inputs with useRef, submit forms with the FormData pattern, and keep state in the URL with useSearchParams. Code snippets show each alternative and when it beats state.
Simplify complicated Typescript - KISS
Simplifying complicated TypeScript with the KISS principle: refactoring examples show when explicit types improve a simple function and when clever type gymnastics make code harder to review, test, and maintain.
Block attackers based on request URL in Ruby app
Blocking bots and attackers by request URL instead of IP: how the url_ban_list gem, born from three years of honeypot observations, recognizes malicious scan paths in your Ruby app and bans the clients requesting them.