So, the compontents involved:
- Drizzle with the rabbitmq plugin, see this blog post for more information on how to get it up and running.
- Drizzle-JDBC to generate the data in the database
- RabbitMQ to transport the transactions from drizzle to the applier
- Your browser, both Chrome and Firefox support web sockets, but for firefox you need to enable them first
The basic flow is this:
- 10 inserts per second are executed in the drizzle database using drizzle-jdbc, these inserts contain a random IP address
- Drizzle does its magic and packages up each insert as a google protobuf transaction message
- The rabbitmq plugin picks up the message and publishes it to a RabbitMQ server
- RabbitReplication consumes the message from RabbitMQ and maps it onto an annotated java object. This gives alot of flexibility to the rabbitreplication user since you can manipulate the information any way you want, in this example i extract a longitude and latitude value from the IP address using MaxMind GeoLite City. Have a look at row the "setSomething()" method in the ExampleRepl.java file. This file is something a rabbitreplication end user would implement and provide
- The java object is serialized to json
- The json string is published to all connected clients
So, I'm hoping the little demo i'm linking below shows some of the extreme flexibility of the Drizzle replication. This, for me, is the unique selling point for Drizzle. Also, if anyone has an actual production use case for this, i'd be extremely happy to help implement it!
(Thanks to Rackspace for hosting!)