JJS
JJS InsightsJatin Jain Saraf (JJS) Insights & Blog
Case StudiesPortfolioCourses
  1. Home
  2. /Blog
Jatin Jain Saraf · JJS InsightsArchitect of SupraScan

What breaks in production databases, and how to fix it.

Notes from running PostgreSQL in production. I'm the architect of SupraScan, a blockchain indexer running 500–1,000 TPS on a database that grew to 10 TB before I cut it to 2.7 TB.

  • 54 articles
  • 12 case studies
  • 8 free courses
Read the flagship case studyGet new posts by emailAbout me

Start here

Case study 01Indexing a Blockchain in Real Time, at ScaleA blockchain never pauses for maintenance. Here's how SupraScan's indexer stays caught up, decomposes every transaction into a dozen relational tables, and survives its own concurrency bugs without losing data.Topic hubPostgreSQL: every article, plus the full courseFrom the first query to the internals that decide how it behaves at 10 TB.Latest articleThe TOAST Tax: How Unbounded JSONB Arrays Cost My Blockchain Indexer 5TBOct 5, 2026

All articles

Content Type

🍞
PostgreSQL

The TOAST Tax: How Unbounded JSONB Arrays Cost My Blockchain Indexer 5TB

Our PostgreSQL blockchain indexer's TOAST table grew past 5TB because unbounded JSONB arrays kept getting bigger. Here's what TOAST was costing us, how to measure it, and how we moved hot JSONB fields into normal columns without taking the indexer offline.

Oct 5, 2026
17 min read
6 tags
PostgreSQLDatabasePerformanceJSONBWeb3Backend
Read article
⚙️
PostgreSQL

Every Postgres Write Triggers Five Background Processes. Here's What Each One Actually Does.

An UPDATE returns in two milliseconds, but underneath, Postgres just ran WAL logging, checkpoint bookkeeping, wait-event tracking, vacuum, and ANALYZE to make that write durable, recoverable, and still fast to plan. Here's what each of those five processes actually does, and which one is usually behind the latency spike that has no slow query in sight.

Sep 14, 2026
8 min read
7 tags
PostgreSQLDatabaseWALVacuumPerformanceBackendSQL
Read article
🐘
ORM

Your ORM Isn't Lying to You. It's Just Not Telling You Everything.

ORMs like Prisma and TypeORM don't lie to you about your database, they just don't tell you everything. Here's where that gap shows up in production: N+1 queries, migrations that silently drop columns, connection pool exhaustion in serverless, and the SQL your ORM actually generates versus what you think it's running.

Sep 3, 2026
13 min read
7 tags
ORMPostgreSQLDatabaseBackendPerformanceSQLPrisma
Read article
🔀
System Design

The Dual-Write Problem: Why "Update the DB, Then Publish an Event" Is Broken

An order gets saved to Postgres. The event that's supposed to tell payments, shipping, and notifications never goes out, because the process crashed one line later. Here's why that gap exists, and the two real patterns (Outbox, Sagas) that close it.

Aug 29, 2026
8 min read
4 tags
System DesignDistributed SystemsBackendArchitecture
Read article
🔍
PostgreSQL

Elasticsearch Isn't Dead. You Probably Don't Need It

Search gets slow, someone says 'we need Elasticsearch,' and two weeks later there's a new cluster, a sync pipeline, and a class of bugs that didn't exist before. PostgreSQL's tsvector, GIN indexes, and pg_trgm cover the full-text and fuzzy-matching workload most teams actually have, without a second database to keep in sync. This is the case for starting there and adding Elasticsearch only when the workload actually demands it.

Aug 21, 2026
7 min read
5 tags
PostgreSQLElasticsearchFull-Text SearchDatabaseBackend
Read article
🐳
Docker

Why Your Docker Image Is 3GB and Nobody Noticed Until the Deploy Timed Out

A deploy that used to take ninety seconds now takes six minutes, and nobody changed the code. The real story is in how Docker layers, build caching, and registries accumulate weight that never comes back off on its own, plus how to actually measure it before you guess.

Aug 19, 2026
9 min read
3 tags
DockerDevOpsPerformance
Read article
🗄️
PostgreSQL

Why Postgres and Cassandra Made Opposite Bets on Storage Engines

A write-heavy ingestion table on Postgres starts choking under load: autovacuum can't keep up, WAL grows fast, and every insert costs more than it should. A Cassandra table doing the same job barely notices. The difference isn't tuning. It's a decision made before either database wrote a single line of code: B-Tree or LSM-Tree.

Aug 15, 2026
8 min read
5 tags
PostgreSQLDatabaseArchitectureSystem DesignBackend
Read article
🌊
Engineering Culture

The Codebase You Sit In Rubs Off On You

Your habits as an engineer aren't shaped by courses and effort alone; they're shaped by the PRs, teammates, and incidents you sit next to every day.

Aug 11, 2026
5 min read
4 tags
Engineering CultureSoftware EngineeringCareerCode Quality
Read article
⚡
PostgreSQL

PostgreSQL's Async I/O Engine: Why Your Sequential Scans Just Got 2-3x Faster

For twenty years, every PostgreSQL process read one disk page at a time and waited. PostgreSQL 18 finally lets it ask for many pages at once. Here's what changed under the hood, and how to verify the gain on your own workload.

Aug 8, 2026
4 min read
4 tags
PostgreSQLDatabasePerformanceBackend
Read article
Browse all 54 articles
  • The TOAST Tax: How Unbounded JSONB Arrays Cost My Blockchain Indexer 5TB
  • Every Postgres Write Triggers Five Background Processes. Here's What Each One Actually Does.
  • Your ORM Isn't Lying to You. It's Just Not Telling You Everything.
  • The Dual-Write Problem: Why "Update the DB, Then Publish an Event" Is Broken
  • Elasticsearch Isn't Dead. You Probably Don't Need It
  • Why Your Docker Image Is 3GB and Nobody Noticed Until the Deploy Timed Out
  • Why Postgres and Cassandra Made Opposite Bets on Storage Engines
  • The Codebase You Sit In Rubs Off On You
  • PostgreSQL's Async I/O Engine: Why Your Sequential Scans Just Got 2-3x Faster
  • Vector Search in Postgres: What pgvector's Indexes Actually Cost You
  • The Three Layers of Failure Isolation: Timeouts, Circuit Breakers, and Load Shedding
  • Connection Pooling in the Serverless Era: Five Failure Modes
  • PostgreSQL 19 vs. 18: What Actually Changed, Feature by Feature
  • Idempotency Keys: How to Make Retries Safe in Distributed Systems
  • How the LRU Cache Actually Works and Why Redis, Browsers, and Postgres All Approximate It
  • Why a Single ALTER TABLE Can Take Down Your Whole Database
  • What the PostgreSQL Server Is Actually Doing
  • Competition Is Inevitable. Cruelty Is Optional
  • Transactions and ACID in Practice: What Every Backend Developer Must Know
  • When Judgment Becomes the Bottleneck
  • Mastering PostgreSQL: 5 Essential Tips for Performance Optimization
  • Redis HyperLogLog: Counting Millions of Unique Users with Just 12KB of Memory
  • Professionalism Isn't Rigidity — It's Responsibility
  • Ownership Mindset: Thinking Beyond Assigned Tasks
  • The React Server Components Vulnerability That Shocked the Web Ecosystem
  • A Redis Command That Quietly Solves One of the Hardest Problems in High-Concurrency Systems
  • The Impact of Words in Professional & Personal Spaces
  • Microservices Don't Collapse Because They're "Too Complex"
  • The Responsibility Behind Honest Feedback
  • Your Blockchain Indexer Is Fine — Until It Isn’t
  • Database Efficiency 101: Understanding Bloat, Vacuum, and the Power of pg_repack
  • The Power of LATERAL Joins: Turning SQL into a “ForEach” Loop
  • PostgreSQL 18: A Paradigm Shift for Modern Data Workloads
  • Cloud‑to‑Cloud Database Migration: A Practical Guide for Large PostgreSQL Systems
  • The Hidden Architecture Behind Six Degrees of Separation
  • The Complete Developer’s Guide to Indexing Assets on Supra & Aptos (Coins, FAs, NFTs)
  • The PostgreSQL Elephant in the Room: A Deep Dive Into the Architecture That Powers Giants
  • From Lag to Leading: A Deep Dive into Fixing a 2-Hour PostgreSQL Replication Lag
  • Taming PostgreSQL Replication Lag in Real-Time Blockchain Indexers
  • Understanding Source Code vs Bytecode in Move-Based Blockchains
  • Demystifying API Gateway Patterns: Design Choices, Real-World Use Cases & When to Use What
  • Handling Large Datasets & High-Traffic Queries: Optimizing Pagination, Sorting & Filtering
  • The Ultimate Git Command Guide: Streamline Your Development Workflow
  • Strings in JavaScript: An In-Depth Guide
  • Choosing Between Type and Interface in TypeScript: A Detailed Guide
  • Unveiling the Power of Descriptive Naming Conventions in JavaScript
  • Navigating Your Career: Deciding Which Skills to Develop at Each Stage
  • What's New in Next.js 14
  • Linux Terminal Basics Commands:
  • JavaScript ES6 Coding Conventions
  • 40 Best Practices for Writing Clean JavaScript, React, and Node.js Code
  • Branching Guidelines and Conventions
  • Clustering In NodeJs
  • Sequelize using Postgres dialect

Get new posts by email

New posts and case studies on PostgreSQL internals and production incidents, plus a short digest when new course modules go live. No spam, unsubscribe in one click.

Prefer a feed reader? Follow via RSS
PortfolioCase StudiesCoursesRSS

© 2026 Jatin Jain Saraf (JJS). All rights reserved.