# Shard routing and consistency in Elasticsearch

**URL:** <https://discuss.elastic.co/t/shard-routing-and-consistency-in-elasticsearch/260361>\
**Category:** Elasticsearch\
**Created:** [January 6, 2021, 3:33pm UTC](https://discuss.elastic.co/t/shard-routing-and-consistency-in-elasticsearch/260361 "2021-01-06T15:33:26Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [January 6, 2021, 3:45pm UTC](https://discuss.elastic.co/t/shard-routing-and-consistency-in-elasticsearch/260361/2 "2021-01-06T15:45:06Z")

</div>

> [@peterol](#):
>
> Is this assumption correct?

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.

> [@peterol](#):
>
> Is this correct, too?

Not really, no; for starters the CAP theorem [doesn't really apply](https://discuss.elastic.co/t/which-side-of-cap-theorem-elasticsearch-satisfy/177810/2) since Elasticsearch isn't a linearisable register, but also Elasticsearch leans more towards consistency over availability for writes. Basically it's complicated.

---

_[View the full topic](https://discuss.elastic.co/t/shard-routing-and-consistency-in-elasticsearch/260361)._
