Back to blog

Making video search faster with PostgreSQL and OpenSearch

3 min readUpdated Oct 29, 2026

At VdoCipher, I worked on search backed by PostgreSQL and OpenSearch. Search response times went from roughly 2–3 seconds to about 200 ms.

These are approximate before-and-after response times.

The problem

The product needed customers to find their videos quickly. Waiting several seconds for a search makes an otherwise useful feature feel slow.

The work involved the backend as well as the interface. PostgreSQL held the application data; OpenSearch provided the search index. Moving retrieval into an index also creates a second representation of that data, and that representation needs to stay useful as the underlying records change.

What I worked on

I worked across the interface and the PostgreSQL/OpenSearch implementation to reduce the time customers spent waiting for results.

The implementation is private. The following notes cover the design questions I would check in a search system.

A fast answer still has to be the right answer

A search result has several kinds of correctness:

  • Relevance: does it return the video the customer is trying to find? Exact identifiers, short prefixes and natural-language searches behave differently.
  • Freshness: does a newly created or edited record appear when expected? What happens after a deletion?
  • Access: is the customer allowed to see every returned record? A search index must not bypass the application’s authorization rules.
  • Failure behavior: what does the interface do if the search service is unavailable or behind the source data?

Those checks belong alongside latency measurements. Making the request quick is only part of making the feature work.

A note about caching and authorization

An earlier version of this article included an oversimplified cache example. It accepted a user identifier but did not include access scope in the cache key. I have removed it because that is not a safe example to copy.

If results differ by customer or permissions, a cache must respect those boundaries. Authenticate and authorize the request before serving a cached result. Include the relevant tenant or authorization scope in the key, and account for permission changes and invalidation. A user identifier by itself is not a complete authorization design.

This correction concerns the published example. It does not describe an observed incident in the production system.

What the result means

The improvement was visible in an ordinary interaction: searching for a video took about 200 ms instead of several seconds. That was the goal, less waiting in a feature customers needed to use.

backendsearchpostgresqlopensearch