~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/replication.rst

  • Committer: David Shrewsbury
  • Date: 2011-03-08 18:17:55 UTC
  • mto: (2226.1.5 build)
  • mto: This revision was merged to the branch mainline in revision 2227.
  • Revision ID: shrewsbury.dave@gmail.com-20110308181755-0s7mi6u8celly6ll
Add documentation about replication streams.

Show diffs side-by-side

added added

removed removed

Lines of Context:
280
280
a single statement, then a message buffering strategy should be employed 
281
281
to guarantee that a statement was indeed applied successfully before
282
282
executing on the receiver.
 
283
 
 
284
Replication Streams
 
285
###################
 
286
 
 
287
The Drizzle kernel handles delivering replication messages to plugins by
 
288
maintaining a list of replication streams. A stream is represented as a
 
289
registered *replicator* and *applier* pair.
 
290
 
 
291
When a replication message is generated within the kernel, the replication
 
292
services module of the kernel will send this message to each registered
 
293
*replicator*. The *replicator* will then do something useful with it and
 
294
send it to each *applier* with which it is associated.
 
295
 
 
296
Replicators
 
297
***********
 
298
 
 
299
A registered *replicator* is a plugin that implements the TransactionReplicator
 
300
API. Each replicator will be plugged into the kernel to receive the Google
 
301
Protobuf messages that are generated as the database is changed. Ideally,
 
302
each registered replicator will transform or modify the messages it receives
 
303
to implement a specific behavior. For example, filtering by schema name.
 
304
 
 
305
Each registered replicator should have a unique name. The default replicator,
 
306
cleverly named **default_replicator**, does no transformation at all on the
 
307
replication messages.
 
308
 
 
309
Appliers
 
310
********
 
311
 
 
312
A registered *applier* is a plugin that implements the TransactionApplier
 
313
API. Appliers are responsible for applying the replication messages that it
 
314
will receive from a registered replicator. The word "apply" is used loosely
 
315
here. An applier may do anything with the replication messages that provides
 
316
useful behavior. For example, an applier may simply write the messages to a
 
317
file on disk, or it may send the messages over the network to some other
 
318
service to be processed.
 
319
 
 
320
At the point of registration with the Drizzle kernel, each applier specifies
 
321
the name of a registered replicator that it should be attached to in order to
 
322
make the replication stream pair.