Saturday, May 18, 2024
No menu items!
HomeCloud ComputingHow Pinecone leverages Spanner’s familiar PostgreSQL to power its vector database

How Pinecone leverages Spanner’s familiar PostgreSQL to power its vector database

At Pinecone, we offer one of the leading vector databases, providing a fully managed, scalable, and easy-to-use platform for vector search. Used by a wide range of customers, including Fortune 500 companies and startups, our vector database helps to power a variety of applications. Recently, we migrated Pinecone’s underlying database engine to Spanner — here is our experience.

Why Spanner?

Our free-tier offering has tens of thousands of active users at any given time, relying on a highly scalable, multitenant architecture that drives down the cost of storage — without sacrificing the user experience. The data plane metadata for each index consists of pointers and manifests that hold a consistent view of the index. Since the critical read path accesses metadata, we needed to store it in a highly available database that provided low-latency point reads. More specifically, we believed that Spanners read replicas as well as its single-digit millisecond read latencies could ensure we had predictable low latency in the critical path for search queries.

We were also looking for a SQL database with transactional semantics that could scale in any dimension. We needed this to support not only our current multi-tenant workloads, but also future as-yet unknown offerings in the fast-moving AI space. It also needed to have extremely high durability and efficient read/write performance, without the operational burden of having to manage sharding, scaling and failover. We were anticipating need to scale Pinecone’s free tier by three orders of magnitude over the coming year, so any database we chose would need to handle that while at the same time being cost-effective.

Spanner checks all of these boxes for us. It is both cost-efficient and massively scalable, while also providing high availability and durability. In addition, Spanner’s PostgreSQL interface offers familiarity and portability. Sweeting the deal for us, Spanner’s recently received significant price-performance improvements, providing up to 50% increase in throughput, 2.5 times the storage per node, and lower latency than before, with no change in price.

Finally, Google Cloud has been a great partner. They are always innovating and adding new features that make it easier for us to build and run our business. We’re excited to see what the future holds for our partnership.

Migration strategy

Given that we already had a free tier offering prior to leveraging Spanner, we had to carefully perform the migration to ensure we provided the best possible user experience, while getting comfortable with running Spanner at increasing scale in production.

After developing, testing, and benchmarking the new free-tier architecture with Spanner PostgreSQL, we implemented feature flagging to divert a small fraction of signups to the new tier. We then spent weeks examining key performance indicators (KPIs) to ensure a positive user experience and expected cost-of-goods sold (COGS).

Over time, we ramped up traffic, and today all new free tier users automatically leverage the new Spanner-based multitenant architecture.

Today, we have close to 40,000 users running on this architecture in production and the overall user experience has been improving, while our costs to support the free tier have reduced by 10x.


The Pinecone-Spanner use case is a great example of how Spanner can be used to build and run innovative and mission-critical workloads.

Due to Spanner’s scalability, reliability and performance, we are able to massively scale free trials offered on Google Cloud to our customers. Spanner’s ability to handle large volumes of data and transactions makes it a great platform to power our platform.

Learn more:

Discover how you can use Spanner and get started with a 90-day free trial instance.

Read more about Spanner’s price-performance improvements.

Cloud BlogRead More



Please enter your comment!
Please enter your name here

Most Popular

Recent Comments