There are a few scenarios where it may be appropriate to partition data horizontally across several servers, with performance being the most obvious reason. The concept itself is known as sharding and is used in many large scale applications, such as Facebook.
In this recipe, we'll show you how to use
NHibernate.Shards to split our data set across three databases.
In SQL Server, create three new, blank databases named Shard1, Shard2, and Shard3. Complete the Getting Ready instructions at the beginning of Chapter 4, Queries.
NHibernate.Shardsusing NuGet Package Manager Console:
Install-Package NHibernate.Shards –Project QueryRecipes