I'm looking for advice on choosing a database that can handle ordered multi-segment keys, like `country#state#city#area`. I need the ability to perform flexible queries where each segment can either be a fixed value, a wildcard (`*`), or completely unrestricted. For instance, queries like `IN#KA#*#*` should bring back all areas in Bangalore, while `IN#*#BLR#*` would give me every entry for the city of BLR, regardless of state. I want to support wildcards in any segment of the key. I'm specifically seeking an AWS-managed database that can efficiently return all the matching entries without requiring me to know all segment values in advance. Which AWS database (like DynamoDB, DocumentDB, Neptune, or OpenSearch) is the best for these types of wildcard queries?
3 Answers
Aurora RDS is a great option too, especially if you're fine with SQL. It could suit your needs, but NoSQL might give you more versatility if you aren't certain about your data access patterns.
You might want to consider using DocumentDB since it’s NoSQL, which fits your preference. It handles regex queries well in MQL, so you can achieve flexible query matching just like you’re looking for!
If you're not entirely sure of your access patterns, I'd recommend sticking with RDS Postgres. It's a solid choice for your needs, and using jsonb can help maintain flexibility as your attributes evolve.

Related Questions
How to Build a Custom GPT Journalist That Posts Directly to WordPress
Cloudflare Origin SSL Certificate Setup Guide
How To Effectively Monetize A Site With Ads