Skip to main content

AI and Automation

Vector Database

A vector database stores embeddings and finds the closest matches fast. At the scale most businesses operate, your existing database can already do this.

Definition

A vector database stores embeddings and answers one question quickly: which stored items are closest in meaning to this one?

What It Actually Means

An ordinary database is built to find exact matches and ranges. Find the customer with this reference, find orders between these dates. Nearest-meaning search is a different operation, and vector databases are specialised for doing it across very large collections.

The Question Worth Asking First

Whether you need a separate one at all. This gets bought reflexively, and at the scale most businesses operate it is unnecessary.

PostgreSQL, with the pgvector extension, does vector search perfectly well into the hundreds of thousands of items. For a business indexing its documents, tickets, product catalogue or knowledge base, that is comfortably enough, and it comes with a significant advantage: one database instead of two.

That matters more than it sounds. A separate vector store means two systems to back up, two to secure, two to keep in step, and a permanent synchronisation problem. When a document is deleted or its permissions change, both have to reflect it. Every extra store is another place for the index to drift out of agreement with reality, and drift here shows up as confident answers from material that should no longer be reachable.

When A Dedicated One Earns Its Place

Large collections, in the millions, where specialised indexing makes a real difference to speed and cost. Very high query volumes. Or a requirement for features the extension does not cover, such as particular filtering or hybrid search behaviour.

Those are real cases, but uncommon ones, and the test is whether anyone can state the expected item count and query rate. If the answer is a shrug, the requirement has not been established and the simpler option is the right starting point.

What To Ask

  • How many items will we index, and how often will it be queried? Ask before choosing anything. The numbers usually settle it.
  • Can we do this in the database we already run? Frequently yes, and it removes an entire class of ongoing work.
  • How does it stay in step with the source data? Updates, deletions and permission changes all have to propagate, and this is the part that decays.
  • How are permissions applied? Filtering has to happen at retrieval, not after, or the system will return things people should not see.
  • What does it cost at rest? Managed vector services bill continuously whether or not anyone is using them.

The Practical Advice

Start with what you have. If you run PostgreSQL, add the extension and measure. The work of generating and maintaining embeddings is identical either way, so nothing is wasted if you later outgrow it, and outgrowing it is a good problem arriving with evidence.

The failure to avoid is choosing infrastructure before the requirement exists, which is common here because the technology is new enough to feel like it needs its own dedicated home. Usually it does not, and the simpler architecture is the one that still works in two years when nobody remembers how the synchronisation was supposed to happen.

More terms are in the glossary.

Portrait of Alexander De Sousa, founder of Digital Royalty
Founder-led
“I’ve put everything I know into how this company works — the standards, the method, the care on every project. It runs through the whole team, and I hold us all to it.”

Alexander De Sousa · Founder LinkedIn

Featured on BBC Radio Solent

Get started

Tell us what you need

A few quick questions, then a straight answer from a real person — usually within a few hours.

What happens next

  1. 1 We reply A real person reads your answers and gets back to you, usually within a few hours.
  2. 2 Questions or a short call If anything isn't clear, we ask by email or book a short call. Before any call we audit your website and make the quick fixes it finds, free.
  3. 3 Your fixed quote A clear, fixed price in writing, within 48 hours of any call. There is no obligation to go ahead.

Tell us what you're working on

Whether it's a new site, a platform, or a process that shouldn't be manual any more — we'll tell you honestly if we can help.