HN
Today

PostgreSQL for Everything

This article boldly claims PostgreSQL can be the 'answer to everything,' from full-text search to AI vector databases, simplifying complex IT stacks by consolidating functions. It's a classic Hacker News magnet, tapping into the perennial debate around tool consolidation versus specialization and the enduring appeal of a robust, open-source workhorse. The provocative title invites both staunch defenders and critical skeptics to weigh in on Postgres's impressive, yet sometimes exaggerated, versatility.

60
Score
29
Comments
#2
Highest Rank
21h
on Front Page
First Seen
Aug 19, 2:00 PM
Last Seen
Aug 20, 10:00 AM
Rank Over Time
255101013252121241914131515191922211821

The Lowdown

The author, Dr. Raphael A. Bauer, passionately argues that PostgreSQL, a database he's used since 2003, is far more versatile than commonly perceived and can replace a multitude of specialized systems, thereby significantly simplifying IT setups. He attributes PostgreSQL's power to its rock-solid stability, ease of use and scaling, and its extensive feature set and extensibility.

  • Replaces Solr and Elastic: Offers integrated full-text search capabilities, avoiding data synchronization issues.
  • Replaces MongoDB: Provides excellent JSON support (jsonb) with fast indexing.
  • Replaces Kafka and RabbitMQ: Can function as a message queue using SELECT .. FOR UPDATE and SKIP LOCKED.
  • Replaces Clickhouse: Handles high-volume time-series data effectively with extensions like TimescaleDB.
  • Vector Database for AI: Leverages pgvector and pgai extensions for AI workflows.
  • Replaces Redis: Can be tuned for high-performance caching using UNLOGGED tables.
  • Replaces File System: Stores raw binary data more efficiently than direct filesystem access in some scenarios.
  • Replaces Graph Databases: Utilizes the LTREE datatype for hierarchical data, and notes native property graph support in PG19.
  • Replaces Microservices: Generates JSON directly from queries, potentially replacing simple data-serving middleware.
  • PlayStation 5 (Humorous): Jokes about an SQL Tetris implementation to demonstrate extreme flexibility.

The author concludes by urging readers to always consider PostgreSQL for new requirements before resorting to "shiny new technology X," asserting its capacity to handle far more than typically imagined.

The Gossip

Capabilities vs. Competence: Postgres's Practical Pitfalls

Commenters largely acknowledge PostgreSQL's impressive versatility but caution against a "PostgreSQL for Everything" approach, especially for complex or high-scale scenarios. They argue that while PG *can* perform tasks like message queuing, full-text search, or vector storage, dedicated tools often offer superior performance, features, and operational simplicity when requirements go beyond basic use cases. Specific concerns are raised about performance implications, cache thrashing, and the lack of advanced features compared to specialized systems like Elastic, Kafka, or Clickhouse. Some also question the practicality of storing large raw data files in PG.

MySQL vs. Postgres: A Historical Heavyweight Huddle

The discussion revisits the historical rivalry between PostgreSQL and MySQL, pondering how PostgreSQL ultimately gained prominence. Commenters note MySQL's early speed advantage (especially with MyISAM) and simpler setup but highlight PostgreSQL's deeper feature set, stricter SQL compliance, and the perceived stability/trustworthiness of an open-source project versus Oracle's ownership of MySQL. Features like advanced indexing, JSON support, and better query planners in Postgres are cited as key differentiators that led to its eventual widespread adoption.

SQLite's Stellar Simplicity Standpoint

A significant portion of the comments champion SQLite, presenting it as an even simpler "for everything" solution for applications not requiring high concurrency or large-scale distributed systems. Proponents praise its daemon-less operation, single-file database, and minimal configuration, emphasizing its suitability for "the long tail of apps/services that aren't the Ubers and AirBNBs of the world" when combined with modern replication strategies like Litestream.

Postgres's Powerful Praises

Many commenters enthusiastically endorse the article's premise, sharing personal anecdotes and examples of successfully leveraging PostgreSQL for a wide array of functionalities. They highlight its robustness, extensibility through features like JSONB and `pgvector`, and the overall benefit of simplifying infrastructure and reducing operational overhead by consolidating services onto a single, battle-tested database. Some users report using Postgres as a SQL DB, JSON DB, vector store, log store, full-text search, queue, and message bus simultaneously.

PostgreSQL for Everything - HN Today