Shard routing and consistency in Elasticsearch

Not really, no. Documents are only made visible to searches after a refresh, so (a) you need to refresh to read your own write, and (b) replicas may be ahead of the primary if they refresh first. It's basically a mistake to distinguish primaries and replicas when talking about these kinds of questions, you should consider them as interchangeable.

Not really, no; for starters the CAP theorem doesn't really apply since Elasticsearch isn't a linearisable register, but also Elasticsearch leans more towards consistency over availability for writes. Basically it's complicated.

2 Likes