Harden your Rails application against SQL injection and RCE after the Fakturownia incident: eliminate legacy Marshal cookie deserialization, handle a leaked secret_key_base safely, restrict PostgreSQL roles, and isolate PDF renderers before an exploit reaches production.
Instagram hit the connection wall, the vertical scaling wall and the ID wall on Postgres, and cleared all three without switching databases. Here is what broke, in what order, plus the logical sharding and Snowflake ID patterns you can copy before your own database runs out of room.
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.
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.
JSONB columns in Ruby on Rails without extra gems: use store_accessor to read and write keys like normal attributes, set sensible defaults, and validate required keys with a small module. Practical code you can drop into a PostgreSQL-backed Rails app.
ACID stands for Atomicity, Consistency, Isolation, and Durability: the four guarantees behind reliable database transactions. Each property explained with a concrete Rails example, like wrapping a money transfer in a transaction so it fully succeeds or rolls back.