5

CloudSearch's results are only Eventually Consistent.

In 95% of my application, this is an acceptable tradeoff for the performance and redundancy that it provides.

In that last 5% though, I find myself POSTing a new SDF Document, and then immediately running a query which I need to reflect the POST that I just did.

Currently, I have a cobbled together solution that involves polling CloudSearch until the results are what I expect, directly after the POST. Unfortunately this has a host of issues ranging from increased cost ($) associated with doing extra reads to race conditions when I have multiple users.

Is there any best practice for dealing with this situation?

xpost from AWS Forums: https://forums.aws.amazon.com/thread.jspa?messageID=470636&#470636

EDIT: Additional info about my specific use case.

I'm taking the results of a search with a number of boolean queries on it, and I want to be able to update one or more documents such that they may no longer should appear in the query, then refresh the view to show the results.

Specifically, I have a bunch of documents with a boolean marking them as "archived"

When I am looking at them in the unarchived view, and then mark them as archived, I want to be able to refresh the view without showing those items.

I'm also using CloudSearch for sorting/filtering/paging, which makes it difficult to insert or modify local copies

biggusjimmus
  • 2,706
  • 3
  • 26
  • 31
  • Did you ever come up with a solution for this? – 1kmonkies Aug 15 '14 at 19:47
  • 3
    Sort of, but I'm not very happy with it. Basically, I ended up putting a cache in front of cloudsearch that holds onto the entries that I know I've modified, and then I merge those cached entries with my search results. I have no idea if this is even resembling best practice for this sort of thing, but it works (at least until I spin up multiple servers =/ ) – biggusjimmus Aug 19 '14 at 22:08

0 Answers0