0
votes

My understanding was that RavenDb was designed so that if one shard goes down, the other shards can operate without problems.

But recently I was implementing ShardingResolutionStrategy and found out the MetadataShardIdFor method. It is the method where for each document type we can specify what shard to use for storage.

So if I get it right, if the shard where Hilo for specific document type is stored is down, we can not create new documents of this type at other shards (at least autogenerated ids will not work). Or may be I am wrong and Hilo is replicated between shards in some magical way?

1

1 Answers

1
votes

Sharding is designed to be independent, but in order to create consistent ids, we need to be able to create them from a consistent store.

Because of that, we separate the notion of splitting data to multiple nodes and HA. The typical scenario is that the metadata shard is independent, and is running with replicated database that is shared on all sharded nodes. In this fashion, if you lose the metadata shard, you just switch over.

This take advantage on the fact that RavenDB sharding & replication are orthogonal