| Ayende @ Rahien |
We are working on creating better experience for RavenDB & Sharding, and that led us to the following piece of code: shardedSession.Load("posts/1234", "post/3214", "posts/1232", "posts/1238", "posts/1232");
And the following Shard function:
public static string[] GetAppropriateUrls(string id)
{
switch (id.Last())
{
case '4':
return new[] { "http://srv-4", "http://srv-backup-4" };
case '2':
return new[] { "http://srv-2" };
case '8':
return new[] { "http://srv-backup-4" };
default:
throw new InvalidOperationException();
}
}
Write a function that would make the minimum number of queries to load of all the posts from all of the servers....(Read whole news on source site)




