Using Elasticsearch for QR-Based Digital Membership Card System

Hi everyone,

I’m working on a digital membership card system where each user is issued a unique QR code that can be scanned for quick verification during events, access control, or attendance tracking. The goal is to keep the system lightweight, fast, and fully self-hosted while handling real-time validation efficiently.

There are already third-party platforms like Membership Anywhere that provide digital membership card solutions, but I’m trying to build a more flexible and self-hosted approach with greater control over data and infrastructure.

In this setup, the digital membership card acts as a scannable identity, and every scan triggers a backend request to validate the user. I’m exploring the use of Elasticsearch to store member data and handle fast lookups during QR scans, especially in scenarios with a large number of users and frequent concurrent requests.

The idea is to index user records and query them quickly based on the QR identifier, while also logging scan events for analytics and auditing. However, I’m currently facing a couple of challenges:

A. What is the best way to structure indices for fast and secure QR-based lookups?

B. Should Elasticsearch be used directly for real-time validation, or combined with another database layer?

Any suggestions on architecture, scaling, or performance tuning would be really helpful.

Welcome to the forum @dicogi - an interesting use case.

Can I ask what attracted you to Elasticsearch? The scenario outlined does not strike me as one where elasticsearch is the natural "best-fit"? Your searches are really just lookups!

When you say “large,” what scale are we talking? Pretty much any RDBMS or key-value store can do "fast lookups" and handle "a lot", many 000s/second, concurrent requests/connections. Elasticsearch can do that too, and it's a lot of other nice features, but it’s optimized for, well, search.

There's certainly a lot of nice things you can with elasticsearch and "member data", pretty and/or cool ways to visualize that data in Kibana, with relatively little effort.