Keep AWS CloudSearchDomain in sync with DynamoDB

I'm trying to add some flexible search features to my dynamoDB, so I set up AWS CloudSearchDomain. In my opinion, you can add a wrapper around my dynamoDB and get documents with flexible search options.

From the moment of implementation, I realized that adding an element to my dynamoDB does not automatically add an element to the searchable CloudSearchDomain documents. AWS docs advise you to periodically synchronize database items with CloudSearchDomain, for example, at the end of each day. But I want my newly added items to be searchable as soon as they are in the database.

I also understand that documents that are returned from the CloudSearchDomain endpoint are not my pure json dynamoDB elements. Each search result is wrapped in a "hits" array, and all property values ​​are wrapped in arrays, and it is just a bit random to process it at the front end. Therefore, it is the right tool for dynamodb flexible search. How do others use CloudSearchDomain with DynamoDB?

Im using javascript sdk with node.js.

+1
source share

Source: https://habr.com/ru/post/989023/


All Articles