Automatically offload dynamo table to cloud search domain

前端 未结 2 835
南方客
南方客 2021-01-03 04:13

I\'m using Dynamo DB pretty heavily for a service I\'m building. A new client request has come in that requires cloud search. I see that a cloud search domain can be created

2条回答
  •  旧时难觅i
    2021-01-03 04:48

    I'm not so clear on how Lambda would always keep the data in sync with the data in dynamoDB. Consider the following flow:

    1. Application updates a DynamoDB table's Record A (say to A1)
    2. Very closely after that Application updates same table's same record A (to A2)
    3. Trigger for 1 causes Lambda of 1 to start execute
    4. Trigger for 2 causes Lambda of 2 to start execute
    5. Step 4 completes first, so CloudSearch sees A2
    6. Now Step 3 completes, so CloudSearch sees A1

    Lambda triggers are not guaranteed to start ONLY after previous invocation is complete (Correct if wrong, and provide me link)

    As we can see, the thing goes out of sync.

    The closest I can think which will work is to use AWS Kinesis Streams, but those too with a single Shard (1MB ps limit ingestion). If that restriction works, then your consumer application can be written such that the record is first processed sequentially, i.e., only after previous record is put into CS, then the next record should be put.

提交回复
热议问题