Created
September 11, 2012 19:22
-
-
Save Aaronontheweb/3701266 to your computer and use it in GitHub Desktop.
ShardStrategy.ShardingOn Example - taken from RavenDB.NET docs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//from http://ravendb.net/docs/server/scaling-out/sharding | |
var shards = new Dictionary<string, IDocumentStore> | |
{ | |
{"Asia", new DocumentStore {Url = "http://localhost:8080"}}, | |
{"Middle East", new DocumentStore {Url = "http://localhost:8081"}}, | |
{"America", new DocumentStore {Url = "http://localhost:8082"}}, | |
}; | |
var shardStrategy = new ShardStrategy(shards) | |
.ShardingOn<Company>(company => company.Region) | |
.ShardingOn<Invoice>(x => x.CompanyId); | |
var documentStore = new ShardedDocumentStore(shardStrategy).Initialize(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment