Enzo SQL Shard 3.0

Rating: No reviews yet
Downloads: 2129
Released: May 29, 2013
Updated: May 30, 2013 by hroggero
Dev status: Stable Help Icon

Recommended Download

Source Code EnzoSQLShard Source Code (Zip)
source code, 278K, uploaded May 30, 2013 - 885 downloads

Other Available Downloads

Documentation Enzo SQL Shard Documentation
documentation, 925K, uploaded May 30, 2013 - 1244 downloads

Release Notes

Release Notes

This version of the Enzo Shard provides support for three sharding Strategy patterns: Compressed Shards, Federation Shards, and Expanded Shards.

This release adds the support for Compressed Shards: a compressed shard allows you to easily manage multiple tenants/customers across multiple databases, either by creating one database per tenant/customer, or by using schema separation to store multiple tenants/customers on one or more databases.

In addition, this release also provides support for the previous sharding strategies: Expanded Shards and Federation Shards. An expanded shard allows you to treat databases as a stripe where tenant data is spread across multiple databases. The Federation shard strategy allows you to leverage the Windows Azure SQL Database Federation feature provided by Microsoft.

Except for the Federation shard (which only works for Windows Azure SQL Database), the expanded and compress shard strategies can function on SQL Server and SQL Database instances.

A sample application and additional documentation has been provided in this version as well to help you build multitenant/SaaS applications using the Compressed shard.

About the Strategy Implementation

This project was reorganized by centralizing common sharding operations in specialized classes. In addition, the basic underlying core logic of performing a shard call was placed in a Core class. By inheriting this class, any new strategy gains access to specific sharding options and settings. This new model was used to adapt the original shard library, now called the Expanded Shard library. The Federation and the Compressed Shard Strategies also use the Core class and additional capabilities provided by this release, such as the Distributed Query (see below). Going forward, the intent is to provide a set of sharding implementation strategies that use the same underlying plumbing.

About the Federation and Compressed Shard Strategies

These two strategies supports the following features:
  • Map Reduce: Fetches across federation members/Tenants in parallel
  • Shard Reduce (Index): Creates a bitmap index of federation members/Tenants
  • Fan Out: Supports execution of parallel execution with the Task Parallel Library
  • New T-SQL Semantics: allows support for an enhanced T-SQL to query across federation members or Tenants

About the Distributed Query

The distributed query allows you to send a SELECT statement in the following format, and get a data table back. The distributed query is analyzed by the library and extracts enough information to determine how to fetch the data across federation member/Tenants.

The distributed query also supports the use of caching with the CACHED FOR clause, and allows exclusion of records from other federation members with the WHERE IN clause.

The statement currently supported is:

SELECT fields USING ( sql1 ) FEDERATED ON {ROOT, (fed_name [, member_key = member_value [, FILTERED]]) }
[WHERE field [NOT] IN ( sql2 ) FEDERATED ON {ROOT, (fed_name [, member_key = member_value [, FILTERED]]) }]
[ORDER BY fields3]
[CACHED FOR n seconds]

Example

For example, the following query returns the MAX customerId of a Customer table. It executes the inner SQL statement across the federation members, then performs the MAX aggregate calculation.

SELECT MAX(customerId) USING (select customerid from customer) FEDERATED ON (customerfederation)

More advanced distributed statements are available in a test application.

Reviews for this release

No reviews yet for this release.