Database Reference
In-Depth Information
You can execute this statement much more quickly because almost the entire time is spent
returning the Document field. Figure 10-12 tells you that returning all the fields against both databases
without the Document field takes only 103 milliseconds. This shows that using a shard can provide
performance benefits even if there is a processing overhead; however, this may not always be the case.
Be sure to carefully evaluate your database design to determine which tables, if any, can take advantage
of parallel execution.
Figure 10-12. Excluding the Document field from the SELECT
Working with Partial Shards
Note that building a shard isn't an all-or-nothing approach. You can easily create a partial shard for a set
of tables. Depending on how your code is structured, you may or may not need to build logic that uses
the shard library, depending on which tables you need to access. This logic is best built in a data access
layer (DAL), where the physical organization of tables is separated from the organization of business
objects.
For example, you can design an application that consumes business objects directly. These business
objects in turn consume command objects, which are specialized routines smart enough to load data in
memory structures by calling execution objects. Figure 10-13 shows the Authors object calling two
command objects that load data from two separate libraries: the standard ADO.NET library and the
shard library. The complexity of determining which library to call is deferred to the lowest level possible,
protecting the application and business objects from database structural changes.
Search WWH ::




Custom Search