Summaries > Technology > Postgres > Postgres is slowly replacing every database...
https://www.youtube.com/watch?v=zPsr0n9DQ7o
TLDR PostgreSQL's 19th beta adds property graph queries, allowing users to query graph-shaped data whileusing a Neo4j-like syntax, though it doesn't offer native graph storage or the performance of dedicated graph databases. This new feature is helpful for tasks like fraud investigations but is not ideal for complex graph traversals, a challenge previously tackled with cumbersome SQL recursive CTEs. Meanwhile, real-world graph database success stories, like the ICIJ's use of Neo4j for the Panama Papers, highlight the effectiveness of proper graph solutions.
With the introduction of the 19th beta version of PostgreSQL, property graph queries have become an exciting feature that allows users to manage graph-shaped data within a relational framework. This new capability enables users to conduct queries on the relationships between entities, akin to graph databases like Neo4j. It’s essential to grasp how these read-only views operate over existing relational tables and to familiarize oneself with the syntax that mirrors Cypher. By understanding these concepts, users can effectively leverage PostgreSQL for specific scenarios involving connected data.
While PostgreSQL's new graph query feature offers a novel approach to handling relationships between entities, it's important to realize its limitations. Notably, PostgreSQL lacks native graph storage, meaning performance may not match that of dedicated graph databases. This is key for workloads that require deep traversals, which are often found in comprehensive graph database applications. Acknowledging these constraints will help users make informed decisions about when to utilize PostgreSQL for graph-related tasks and when to consider more suitable alternatives.
To take full advantage of PostgreSQL's property graph queries, users should focus on specific use cases where this feature shines. Applications such as authorization graphs and fraud investigation are ideal scenarios. By tailoring graph querying to these needs, users can streamline their data analysis and make more effective use of the technology. Carefully identifying appropriate use cases will lead to more efficient database management and enhanced data insights.
As the graph query syntax has been standardized in 2023 by an ISO committee, staying informed about these standards is crucial for developers and database administrators. Understanding industry standards will not only help you to create more efficient queries but also ensure compatibility with evolving database technologies. Engaging with the community and following updates from PostgreSQL and other databases can further enhance your understanding and capabilities in utilizing graph queries.
Examining successful applications of graph databases can provide valuable insights into best practices and potential pitfalls. A notable example is the International Consortium of Investigative Journalists using Neo4j to analyze the Panama Papers, illustrating the power of graph databases in handling large sets of unstructured data. By studying such cases, you can gain inspiration for implementing graph technologies within your own projects, particularly in organizing and analyzing complex data relationships.
The new feature introduced is property graph queries, which allow users to query graph-shaped data within a relational database.
Postgres 19 defines property graphs as read-only views over relational tables, using a syntax similar to Neo4j's Cypher language for querying.
The new feature lacks native graph storage, meaning the graph layout is just metadata over existing tables and does not offer the performance benefits found in native graph solutions. It is designed for specific use cases and is not suitable for workloads requiring extensive deep traversals.
The International Consortium of Investigative Journalists (ICIJ) utilized Neo4j to analyze the Panama Papers, processing 11.5 million documents, approximately 2.6 terabytes.
ICIJ used various tools including Apache Tika for text extraction, Tesseract for OCR, and Apache Solr for search indexing, along with Blacklight for a user-friendly search interface.
For 15 years, graph traversal has been simulated using recursive common table expressions (CTEs), which resulted in complicated SQL that was difficult to debug.