pgEdge Announces GA, Vector Search with pgvector Extension
The edge Postgres database pgEdge has added support for the open source extension pgvector, enabling users to perform vector similarity search along with their Postgres data. It also has announced general availability of self-hosted pgEdge Platform after a seven-month beta.
“What’s really cool about this is the combination of pgvector and pgEdge [is] we actually make it a distributed vector database. That means that these similarity searches that are part of AI-powered applications can happen closer to where the users happen to be located,” said Phillip Merrick, co-founder and CEO of pgEdge of the new vector search capabilities.
Of the GA announcement, he added, “With these new features and enhancements, we are pleased to be able to support customers taking their distributed Postgres applications into production.”
A Vector Database Gold Rush
With the rise of generative AI tools like ChatGPT, OpenAI’s GPT-4 and Llama from Meta, there’s been a rush to vector databases to store and index the mathematical representations of pieces of text trained by large language models called vector embeddings.
There are open source vector databases like Chroma, Pinecone, Milvus and Weaviate, and existing databases like MongoDB and DataStax, which is built on open source Cassandra, also have added vector-handling capabilities. And content delivery network Cloudflare recently announced its own vector database among its AI tools.
Pgvector is an increasingly popular community-built extension for PostgreSQL to store vector embeddings from AI models and to provide similarity search capabilities. It enables users to store vector embeddings alongside JSON or other relation data in one database, rather than a dedicated vector database. It is particularly useful with applications involving natural language processing, including those built on OpenAI’s GPT models.
The similarity search can be used to create product recommendations, identify potential fraud and other uses.
Though the extension is written in C, you can use pgvector with any language with a Postgres client, such as Go, Ruby, Rust and more. You can even generate and store vectors in one language and query them in another.
Amazon Web Services uses pgvector in a PostgreSQL-compatible edition of Amazon Aurora, as does Google in Cloud SQL.
This extension adds a vector data type to Postgres, along with three query operators designed for similarity search: Euclidean, negative inner product and cosine distance. It also incorporates the inverted file with stored vectors (ivfflat) indexing mechanism, which accelerates approximate distance searches for vectors.
“PgEdge combined with the pgvector extension is a powerful combination that puts inference and similarity search requests closer to the users giving them faster search results regardless of where they are located,” said Cemil Kor, head of product at Enquire AI.
Merrick said pgEdge added vector search due to customer requests.
“There are some purpose-built vector databases out there in the market, but for people that want to stick with Postgres, pgvector has become very popular for that purpose,” said Merrick. “The combination of pgvector and pgEdge makes it possible to deliver on these AI-powered applications on a global basis without distant users seeing very slow response times.”
This blog post explains how to configure pgvector with pgEdge to provide similarity search functionality across a distributed PostgreSQL cluster.
Distributed Postgres at the Edge
Merrick and Denis Lussier, the creators of EnterpriseDB, created pgEdge to bring a distributed Postgres database closer to the network edge. The edge, which can include Internet of Things devices, 5G and smart devices, faces challenges including data latency, ultra-high availability and data residency restrictions.
While edge development platforms like CloudFlare Workers, Fastly, Netlify or Vercel are focused on making more traditional web and enterprise applications faster by putting more of the application components closer to the edge, pgEdge is bringing the database closer as well.
pgEdge Platform runs on a variety of common hardware and OS combinations and is available to self-host or self-manage with enterprise class support in either on-premises environments or with existing cloud accounts with major providers such as AWS, Microsoft Azure and Google Cloud Platform.
The open source fully distributed PostgreSQL database offers a multimaster (active-active) distributed database system allowing read and write operations at any node on the network. The nodes run standard Postgres (v16) and can span multiple cloud regions and data centers. Loosely coupled, the nodes are kept updated via asynchronous logical replication with conflict resolution using Spock, a standard Postgres extension.
Enhancements with the GA announcement include:
- Anti-Chaos Engine, which ensures consistency between nodes in a pgEdge distributed cluster. It uses Merkel trees to provide background and to compare tables with hundreds of millions of rows between nodes.
- Synchronous read replicas within regions, using Patroni and etcd, complementing the cross-region failover and resiliency between regions inherent to the pgEdge multi-master architecture.
- Support for the Rust-based connection pooler pgCat, adding to the more than 20 other Postgres extensions that pgEdge supports including pgBackrest, PostGIS, PLpgSQL, PL/Profiler and pgBouncer.
Its fully managed cloud service, pgEdge Cloud, will be generally available within a few months.