In DynamoDb, how efficient will it be to store all...
# random
s
In DynamoDb, how efficient will it be to store all possible substrings of a title as different items in a separate table as a partition key, with just the id mapped to later perform substring search on? 😅
f
Hey @Sam, i mean it will work… lol
If you just want to stick with DynamoDB, and not use RDS, ElasticSearch, Athena… I actually can’t think of a better way to do text search.
j
@Sam I thought about this exact same question a few weeks ago when I tried to design a serverless pub-sub service using websocket api + dynamodb + lambda with topic filtering capability (much like aws iot core but without it). ✅ Managing substrings that
startswith
or
endswith
is doable. 🔴 Managing substrings in the middle (wildcards within the topic, in my case), that's... endless.
g
depending of the number of records: fetch all of them and perform the search in code.. But elasticsearch would give you more power when doing full text search.. a good way to keep the index updated is to use dynamodb streams.. We do this often here and it seems to be working just fine. Most of the time, for us here, elastic is a custom replica of dynamo that allow us to perform search and complex filtering.. but our entry point is always dynamodb