postgres
postgres
architecture
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.
development
The challenge of measuring developer productivity- the SPACE framework
Measuring developer productivity with one metric backfires: lines of code and commit counts create misleading incentives. The SPACE framework tracks five dimensions (satisfaction, performance, activity, collaboration, efficiency) for an honest picture of a team.
Latest
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 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.
How to effectively manage and terminate old PostgreSQL connections
Idle PostgreSQL connections eat memory and can hit the max_connections limit, blocking your app. How to find old sessions in pg_stat_activity, close them safely with pg_terminate_backend, and automate the cleanup so hanging connections never pile up again.
How can the AASM state machine be replaced with built-in Ruby on Rails methods?
AASM adds complexity most Rails apps don't need. How to replace the state machine gem with Rails 7.1+ enum, validations, and small service objects: a project management example with forms, translations, unit tests, multiple enums, and state history tracking.
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.
ActiveJob::Continuable - Interrupting and resuming jobs in Ruby on Rails
ActiveJob::Continuable lets long-running Rails jobs survive restarts: split work into steps, track progress with cursors and checkpoints, and resume exactly where the job stopped. Covers error handling, queue adapter support, and a practical example.
14 powerful Rails console tricks that will supercharge your debugging
Rails console tricks that speed up debugging: silence SQL logs, reuse the last result with underscore, inspect routes and schema, find where a method is defined, run rake tasks and raw SQL, time operations, and several more you probably haven't used yet.
How to create a custom rubocop rule to improve code quality?
Custom RuboCop cops let you enforce your project's own conventions. Step by step: how cops inspect the abstract syntax tree, writing a cop that bans hardcoded phone numbers, wiring it into your RuboCop config, and watching it flag offenses in action.
How to extend rake tasks with pre and post hooks in Ruby on Rails
Rake's enhance method adds pre and post hooks to any task without touching its code: back up the database before migrations run, or send a notification after a deploy task completes. Examples of prerequisites, post-execution blocks, and combining both hooks.
Transforming YAML config files into Ruby objects with helpers
YAML config files don't have to end up as messy nested hashes. Turn them into real Ruby objects with validation and custom methods: a small model class that loads the YAML, exposes clean accessors, and grows with your Rails app's configuration needs.
Ruby as a Bash replacement: Writing powerful system scripts in Ruby
Ruby can replace Bash for system scripts that outgrow a few lines: real error handling, readable syntax, easy testing. Examples of bulk folder compression, process management, file operations, making scripts executable, and when Bash is still the better pick.
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.
Creating predictable randomness in Ruby: The magic of seeds
Reproducible randomness in Ruby sounds like a contradiction, but seeds make it easy: how pseudo-random generators work, fixed seeds for tests, debugging, and procedural generation, creative ways to pick seeds, and the pitfalls that quietly break determinism.
Leveraging JSON in PostgreSQL 17
PostgreSQL 17 finally implements the SQL/JSON standard: constructors like JSON_OBJECT and JSON_ARRAYAGG, query functions JSON_EXISTS and JSON_QUERY, and the star of the release, JSON_TABLE, which turns JSON into rows, shown on a real IoT data example.
What is the difference between Fixtures and Factories in Ruby on Rails tests?
Fixtures or factories for Rails tests? How each approach works: static YAML data Rails loads before every run versus FactoryBot objects built on demand, with examples and clear guidance on when speed favors fixtures and flexibility favors factories.
How to enable or disable prefetching in Ruby on Rails and Turbo
Turbo prefetching loads pages on hover, which is great until links point at heavy reports or expensive queries. How the data-turbo-prefetch attribute works, disabling it globally or per link in Rails, and when selective prefetching saves your server.
PostgreSQL indexing for newbies - Practical Guide
PostgreSQL indexing explained for beginners: how B-tree, BRIN, GIST, and GIN indexes work, reading EXPLAIN ANALYZE to see if they are used, maintenance and hit rate tips, and clear rules for when an index helps and when it just slows your writes down.