Database Reference
In-Depth Information
Figure 10-13. Example application design implementing a partial shard
Managing Transaction Consistency
Because this library is meant for SQL Azure, and distributed transactions aren't supported in SQL Azure,
the shard library doesn't offer transactional consistency by default. But you should look carefully at your
transactional needs and what this means to your application design.
You can add transactional capabilities in the shard library fairly easily by changing the
ExecuteShardNonQuery and ExecuteParallelRoundRobinLoad methods. To do so, you need to add a
separate transaction context to all connection objects and commit them in a loop at the end of the last
execution. If any exception occurs, you must roll back all the changes.
Note As mentioned earlier, the shard library is an open-source project and is likely to evolve over time. Check
for the latest release to see which features are supported.
Managing Foreign Key Constraints
Another interesting issue to consider in shard databases is related to foreign key constraints. Because the
shard library proposed in this topic splits tables horizontally, you may quickly realize that maintaining
referential integrity can be challenging.
Search WWH ::




Custom Search