Best of DatabaseJanuary 2026

  1. 1
    Article
    Avatar of lobstersLobsters·19w

    I Replaced Redis with PostgreSQL (And It's Faster)

    PostgreSQL can replace Redis for caching, pub/sub, job queues, and sessions using UNLOGGED tables, LISTEN/NOTIFY, SKIP LOCKED, and JSONB. While PostgreSQL is 50-158% slower per operation (0.1-1ms difference), it eliminates network hops between databases, reduces infrastructure costs by ~$100/month, simplifies operations, and guarantees transactional consistency. The approach works best for small-to-medium apps with simple caching needs but isn't suitable for high-throughput scenarios (100k+ ops/sec) or applications requiring Redis-specific data structures like sorted sets or HyperLogLog.

  2. 2
    Article
    Avatar of devjourneyDeveloper's Journey·19w

    It Worked in Dev. It Worked in QA. Then Production Happened.

    A backend engineer shares a production incident where an appointment-fetching endpoint worked fine in dev and QA but caused 4-second response times in production. The issue was an N+1 query problem: the code made 6,000+ individual database calls to fetch patient details. The solution involved batching patient data retrieval into a single query using in-memory maps and adding proper projections, reducing latency to 500-600ms. The incident highlights the importance of testing with realistic data volumes, thorough code reviews, and anticipating edge cases during development.

  3. 3
    Article
    Avatar of supabaseSupabase·17w

    Introducing: Postgres Best Practices

    Supabase released Agent Skills for Postgres Best Practices, a collection of 30 rules across 8 categories to help AI coding agents write correct, performant Postgres code. The rules follow the Agent Skills open standard and cover critical areas like query performance, connection management, Row Level Security, schema design, and concurrency. The repository addresses common mistakes seen across hundreds of thousands of Postgres projects, such as missing indexes, RLS bypasses, and connection pool exhaustion. These best practices complement the Supabase MCP server by teaching agents proper judgment while the MCP server handles database connections and execution.

  4. 4
    Article
    Avatar of phProduct Hunt·17w

    RelateDB: Offline-first database schema designer in your browser

    RelateDB is a browser-based database schema designer that works entirely offline without requiring accounts or cloud services. It allows developers to visually model tables and relationships, import and export SQL or DBML formats, auto-arrange diagrams, and export schemas as images. All functionality runs locally in the browser for fast, frictionless schema design.

  5. 5
    Article
    Avatar of openaiOpenAI·17w

    Scaling PostgreSQL to power 800 million ChatGPT users

    OpenAI scaled PostgreSQL to handle millions of queries per second for 800 million ChatGPT users using a single primary Azure PostgreSQL instance with nearly 50 read replicas across multiple regions. Key optimizations included offloading reads to replicas, migrating write-heavy workloads to sharded systems like CosmosDB, implementing PgBouncer for connection pooling, deploying cache locking to prevent cache-miss storms, isolating workloads to prevent noisy neighbor issues, and enforcing strict rate limiting. The architecture achieved five-nines availability with low double-digit millisecond p99 latency despite PostgreSQL's MVCC limitations for write-heavy workloads.

  6. 6
    Article
    Avatar of stitcherstitcher.io·17w

    Processing 11 million rows in minutes instead of hours

    A developer optimized their blog's analytics system to process 11 million events, improving performance from 30 to 14,000 events per second through systematic changes: removing unnecessary database sorting, reversing nested loops, ditching the ORM for raw queries, replacing closures with while loops, fixing framework serialization overhead, and using indexed ID-based pagination instead of offsets. The rebuild time dropped from 50 hours to 10 minutes per projector.

  7. 7
    Video
    Avatar of kikisbytesKiki's Bytes·18w

    How I Corrupted 2 Million+ DB Records in Prod

    A migration script to encrypt sensitive user data in MongoDB corrupted over 2 million records by accidentally wiping out unencrypted fields. The bug occurred because MongoDB's $set operation replaces entire nested objects rather than merging properties. Running the migration twice resulted in both encrypted and unencrypted fields being set to undefined, causing queries to return millions of records and spike memory usage in Kubernetes pods. Recovery required restoring a database backup from before the migration and cross-referencing with Redshift data to identify users who registered during the incident window.

  8. 8
    Article
    Avatar of databasedailyDatabase Daily·16w

    A real production SQL query showed me why working SQL isn’t always correct.

    A blog post shares practical SQL lessons learned from a real production query, covering data grain mistakes like duplicate handling, CASE statement priority ordering, collation issues that affect joins, and techniques for writing queries that produce decision-ready results.

  9. 9
    Article
    Avatar of atomicobjectAtomic Spin·17w

    Kysely: Type-Safe SQL Without ORM Overhead

    Kysely is a TypeScript SQL query builder that provides strong type safety without the complexity of a full ORM. It catches common database bugs like mistyped column names and incorrect return types at compile time through TypeScript inference. The library offers a thin abstraction over SQL with readable chaining syntax, strongly typed where clauses, intuitive migrations with up/down functions, and automatic type generation from database schemas using kysely-codegen. Unlike ORMs, it stays focused on query building while maintaining SQL-like expressiveness, making it suitable for teams comfortable with SQL who want compile-time safety and lightweight tooling.

  10. 10
    Article
    Avatar of stitcherstitcher.io·16w

    Once again processing 11 million rows, now in seconds

    A PHP developer optimizes a script processing 11 million database events, improving performance from 50k to 1.7M events per second through incremental changes. Key optimizations include combining SQL inserts, moving calculations from MySQL to PHP, eliminating object instantiation in favor of raw arrays, and removing JSON deserialization by using direct database columns. The journey demonstrates the trade-offs between code convenience and raw performance, with the final implementation processing data in seconds rather than days.

  11. 11
    Article
    Avatar of lobstersLobsters·18w

    Stop using MySQL in 2026, it is not true open source

    MySQL's development has significantly declined under Oracle's stewardship, with commit activity dropping sharply in 2025 and staff reductions announced. Oracle conducts all development behind closed doors, rejecting community contributions and treating MySQL as open source only by license, not practice. Technical issues have plagued recent releases, including data corruption bugs, performance regressions of 15%, and difficult upgrade paths. Oracle published 123 CVEs in 2025 with minimal transparency compared to MariaDB's 8. Migration to MariaDB is straightforward for most applications, offering true open source development with active community participation. Major platforms like Wikipedia and 57% of WordPress sites already use MariaDB.

  12. 12
    Article
    Avatar of infoqInfoQ·16w

    OpenEverest: Open Source Platform for Database Automation

    Percona announced OpenEverest, an open-source platform for automated database provisioning and management on Kubernetes. Built on Kubernetes operators, it supports MySQL, PostgreSQL, and MongoDB, offering features like automated backups, scaling, and disaster recovery while avoiding vendor lock-in. The platform provides both a web UI and REST API for managing database clusters. Originally launched as Percona Everest, it's transitioning to independent open governance with plans to donate to the CNCF. The latest version adds PostgreSQL 18.1 support and NodePort networking, with future plans to support ClickHouse, Vitess, and observability integrations.

  13. 13
    Article
    Avatar of infoqInfoQ·20w

    Bun Introduces Built-in Database Clients and Zero-Config Frontend Development

    Bun 1.3 introduces zero-configuration frontend development with hot module replacement, a unified database API (Bun.SQL) supporting MySQL, PostgreSQL, and SQLite without external dependencies, and a built-in Redis client claiming 7.9x performance over ioredis. The release includes enhanced package management with dependency catalogs for monorepos, isolated workspace installs, and interactive dependency updates. Performance improvements include 10-30% reduced memory usage in frameworks like Next.js, 60% faster macOS builds, and 9% faster Express benchmarks. Breaking changes affect TypeScript types for Bun.serve() and SQL client usage patterns.

  14. 14
    Article
    Avatar of duckdbDuckDB·16w

    Announcing DuckDB 1.4.4 LTS

    DuckDB 1.4.4 LTS has been released with bugfixes, performance improvements, and security patches. Key fixes include correctness issues with ANTI JOINs, ASOF joins, streaming window unions, and the mode() function in parallel execution. The release also addresses several crashes and segfaults, including issues with Hive partitioning and the C API. Performance optimizations include improved prepared statement parameter lookups. Version 1.5.0 is planned for the coming month, while the 1.4 LTS line will receive updates until mid-September.

  15. 15
    Article
    Avatar of notedNoted·18w

    Portabase: A Lightweight Self-Hosted Database Backup Solution

    Portabase is a self-hosted database backup and restore tool supporting PostgreSQL, MySQL, and MariaDB. It uses a central server for management and lightweight agents that operate in outbound pull mode, eliminating the need to expose databases to the internet. The platform features three retention strategies (fixed count, time-based, GFS rotation), supports S3-compatible storage backends, and integrates with notification platforms like Slack and Discord. The central server is built with Next.js 16 and PostgreSQL, while agents have been refactored from Python to Rust for better performance and a 4x smaller Docker image.

  16. 16
    Video
    Avatar of kevinfaangKevin Fang·19w

    Dev Picks the Wrong Database, Takes Down Company

    Element Creations experienced a 24-hour outage of the matrix.org home server after an engineer accidentally deleted the production database while attempting to restore a failed server. The incident began with a hardware failure requiring database migration, but confusion over which server was primary led to running a destructive command on the wrong machine. Recovery took over a day due to slow backup restoration (51TB), a bug in their backup tool that wasn't patched in production, and slow write-ahead log replay. The postmortem emphasizes faster backup restoration strategies, including local snapshots using copy-on-write filesystems like ZFS, and highlights how operational errors during high-pressure situations are nearly inevitable.

  17. 17
    Article
    Avatar of hnHacker News·16w

    Deep dive into Turso, the "SQLite rewrite in Rust"

    Turso is a new database engine written in Rust that maintains compatibility with SQLite's file format while addressing long-standing limitations. It adds built-in encryption, MVCC with concurrent writes support, and async I/O with io_uring. Unlike SQLite, Turso can scale from in-process usage to networked deployment across multiple machines, making it suitable for projects that start small but may need to scale. The project supports extensions through a Rust SDK and aims to combine the simplicity of embedded databases with the scalability of traditional client-server databases.

  18. 18
    Article
    Avatar of neontechNeon·17w

    The Neon VS Code Extension Just Got a Big Update

    Neon's VS Code extension has been rebuilt to provide native database management directly in the editor. The update removes the Docker-based local proxy, automatically detects Neon connection strings in projects, and enables developers to browse schemas, manage tables, run queries, and switch between Neon branches without leaving VS Code. The extension now includes built-in MCP server support and offers a streamlined authentication flow with automatic project detection.

  19. 19
    Article
    Avatar of clickhouseClickHouse·17w

    Fast, scalable, enterprise-grade Postgres natively integrated with ClickHouse

    ClickHouse announces a managed Postgres service backed by NVMe storage, delivering up to 10X faster performance for disk-bound workloads. The service integrates natively with ClickHouse through CDC capabilities and the pg_clickhouse extension, enabling a unified data stack that combines transactional (Postgres) and analytical (ClickHouse) workloads. Built in partnership with Ubicloud, it offers enterprise-grade features including high availability, automatic backups, and point-in-time recovery, with all integration components being open source.

  20. 20
    Article
    Avatar of lobstersLobsters·19w

    PostgreSQL 18 RETURNING Enhancements: A Game Changer for Modern Applications

    PostgreSQL 18 introduces enhanced RETURNING clause capabilities with OLD and NEW aliases, allowing developers to capture both before and after states of data in INSERT, UPDATE, DELETE, and MERGE operations within a single atomic statement. This eliminates the need for separate SELECT queries, complex triggers, or application-level change tracking. The feature is particularly powerful for MERGE operations, enabling sophisticated upsert patterns with complete visibility into what changed. Practical examples demonstrate building audit trails, tracking inventory changes, and comparing values without additional database round trips or trigger overhead.

  21. 21
    Article
    Avatar of postgresPostgreSQL·19w

    Introducing pgpm: A Package Manager for Modular PostgreSQL

    pgpm is a new package manager for PostgreSQL that enables developers to share and reuse application-level database logic (schemas, tables, functions, policies, triggers) as modular, versioned packages. Unlike traditional PostgreSQL extensions that operate at the system level, pgpm works at the application layer using pure SQL, requiring no superuser access or compilation. It organizes code into workspaces with explicit dependency management, automatic resolution, and deterministic deployment order. The tool supports test-driven development with ephemeral databases and CI/CD integration, drawing inspiration from Sqitch while adding recursive composition and modular packaging capabilities.

  22. 22
    Article
    Avatar of csharpcornerC# Corner·18w

    Why ASP.NET Core Feels Fast Locally but Slow in Production

    ASP.NET Core applications often run fast locally but slow in production due to environment differences, resource constraints, database query inefficiencies, async/await misuse, excessive logging, cold starts, improper caching, and network latency. The guide covers common bottlenecks like EF Core N+1 queries, thread pool starvation from blocking calls, logging overhead, in-memory cache limitations in scaled environments, and HttpClient socket exhaustion. It provides code examples showing problematic patterns versus optimized alternatives, emphasizing measurement-driven optimization: timing requests and database queries, checking thread pool health, reducing allocations, and implementing distributed caching before scaling infrastructure.

  23. 23
    Article
    Avatar of datadogDatadog·16w

    Debug PostgreSQL query latency faster with EXPLAIN ANALYZE in Datadog Database Monitoring

    Datadog Database Monitoring now automatically collects PostgreSQL EXPLAIN ANALYZE execution plans to help troubleshoot slow queries. The feature processes plans captured by PostgreSQL's auto_explain extension, correlates them with APM traces, and provides interactive visualizations. Key use cases include identifying incorrect row estimates that cause inefficient join strategies, and analyzing cache hits versus disk reads to determine whether performance issues stem from I/O bottlenecks or query optimization needs.

  24. 24
    Article
    Avatar of depeszdepesz·20w

    Waiting for PostgreSQL 19 – Implement ALTER TABLE … MERGE

    PostgreSQL 19 introduces ALTER TABLE commands for merging and splitting partitions. The new MERGE PARTITIONS command combines multiple partitions into one, while SPLIT PARTITION divides a single partition into several. Both operations currently hold ACCESS EXCLUSIVE locks during execution, making them unsuitable for large tables under high load, but they provide a foundation for future optimizations with reduced locking and potential parallelism. These features were previously attempted in PostgreSQL 17 but were rolled back due to issues.

  25. 25
    Article
    Avatar of flydotioFly.io·16w

    Litestream Writable VFS

    Litestream VFS now supports write operations and background hydration for faster cold starts. The writable VFS mode buffers writes locally and syncs to object storage periodically, enabling single-writer scenarios with eventual durability. Background hydration pulls the full database from S3 while serving reads remotely, then switches to the local copy when ready. These features power Fly.io's Sprites storage stack, where every Sprite boots with 100GB of durable storage in under a second by using Litestream SQLite with S3-backed block maps.