To learn how to implement the RavenDB database sharding, we will create a new application (ShardRavenDB
) which we will use to create and interact with shards. But before doing that, we need to prepare the shard infrastructure by simulating a RavenDB cluster and running more than one RavenDB server. Then, we will create some empty databases which we will populate when running the application.
Let's say that in our application, we have to handle data from the world's countries. Our choice would be to store countries data on a shard which depends on continents. For example, the countries in Asia will be stored on one shard named AS
for Asia, the countries in Europe will be stored on a second shard named EU
for Europe, the North American countries would be stored on a third shard named NA
for North America, and so on. The next figure illustrates the basic shard infrastructure for the ShardRavenDB
application which will communicate with shards using...