2

I am new to DynamoDB and I am looking for suggestions / recommendations. There's a use case where we have a paginated API and we have to search for multiple values of an indexed attribute. Since DynamoDB allows only one value to be searched for an indexed attribute in a single query, a batch call should be done. However, since it requires pagination (batch call would make the pagination complicated), therefore currently, the required IDs are fetched from ElasticSearch for those multiple values (in a paginated way) after which the complete documents are fetched from DynamoDB based on IDs obtained from ElasticSearch. Is this the correct approach or is there any better alternative?

  • 1
    It would work. You don’t say if you’re optimizing for cost, performance, scale, or simplicity. So hard to know if this is “best” without knowing a fitness metric. But if it works for you, is fast enough, and is affordable, and will scale as you need then: success! – hunterhacker Jun 01 '22 at 20:55
  • Everything is possible but I don't understand why you use two services if you can only use one (without knowing about your business). I would have to understand why you don't just use elasticsearch and I would abandon DynamoDB, from what you said I don't see much sense in using it but my view is based on the data you informed. – rabbitbr Jun 02 '22 at 00:34
  • Dynamo db Global secondry index can help you search on non key attrinutes. but that again depends how many search paramters you have . solution you gave maybe correct but looks complicated . More business context would help in taking a better decision . what is data like etc – divyanayan awasthi Jun 02 '22 at 06:21
  • If you are optimising AWS costs and your data is changing less than once a second, and you don't have too much data to search *for this query* you could write the minimal information to SQLite, and store the sql file in S3. I can store and search 1,000,000 items efficiently this way without managing an elastic cluster. Pure serverless. – Ross Williams Jun 02 '22 at 10:48

0 Answers0