Database Reference
In-Depth Information
Mirrors. An exact replica of a primary database (or a large portion of the
primary database that is of interest). Databases in a mirror configuration
obtain their data at roughly the same time using a synchronization
mechanism like SQL Data Sync. For example, a mirror shard made of two
databases, each of which has the Sales table, has the same number of
records in each table at all times. Read operations are then simplified (no
rules needed) because it doesn't matter which database you connect to; the
Sales table contains the data you need in all the databases.
Shard definition. A list of SQL Azure databases created in a server in Azure.
The consumer application can automatically detect which databases are part
of the shard by connecting to the master database. If all databases created
are part of the shard, enumerating the records in sys.databases gives you all
the databases in the shard.
Breadcrumbs. A technique that leaves a small trace that can be used
downstream for improved decisions. In this context, breadcrumbs can be
added to datasets to indicate which database a record came from. This helps
in determining which database to connect to in order to update a record and
avoids spreading requests to all databases.
When using a shard, a consumer typically issues CRUD (create, read, update, and delete)
operations. Each operation has unique properties depending on the approach chosen. Table 2-2
outlines some possible combinations of techniques to help you decide which sharding method is best
for you. The left column describes the connection mechanism used by the shard, and the top row
identifies the shard's storage mechanism.
Table 2-2. Shard access techniques
Horizontal partitions
Mirror
Decision rules
Rules determine how equally records
are spread in the shard.
Create : Apply rules.
Read : Connect to all databases with
rules included as part of a WHERE clause,
or choose a database based on the
rules. Add breadcrumbs for update and
delete operations.
Update : Apply rules or use
breadcrumbs, and possibly move
records to another database if the
column updated is part of the rule.
Delete : Apply rules, or use
breadcrumbs when possible.
This combination doesn't seem to
provide a benefit. Mirrored databases
aren't partitioned, and so no rule exists
to find a record.
Round-robin
Records are placed randomly in
All records are copied to all databases.
Search WWH ::




Custom Search