← Back to team overview

drizzle-discuss team mailing list archive

Re: Marcus Eriksson: Drizzle replication to WebSockets

 

zOmg. Marcus - that is completely and totally fantastic.

Planet Drizzle: Marcus Eriksson wrote:
> 
>   Marcus Eriksson: Drizzle replication to WebSockets
>   <http://developian.blogspot.com/2009/12/drizzle-replication-to-websockets.html>
> 
> I just pushed a WebSocket applier to RabbitReplication, and yes, it is
> as crazy as it sounds. It works pretty much like all appliers - it
> consumes drizzle transactions from  RabbitMQ, converts them into objects
> by inspecting annotations, marshalls the object to JSON, and then stores
> the JSON string. In this case it stores it to a set of websockets.
> RabbitReplication is deployed as a war file to Jetty 7.01
> <http://www.eclipse.org/jetty/> which supports websockets.
> 
> DEMO <http://marcus.no-ip.biz:8082/rabbitrepl/>
> 
> I set the demo up on my server at home (in Sweden) on a DSL line, so it
> might be slow, but it should show the idea, all operations are instant
> when latency is low (if anyone wants to host it at a better place,
> please let me know. Of course, *it requires a WebSocket capable browser*
> and the only one I know of is Google Chro! me
> <http://www.google.com/chrome>.
> 
> It works like this:
> 
>    1. INSERT is executed from the "drizzle client" webapp - totally
>       separate webapp that uses drizzle jdbc to insert/update/delete data.
>    2. Drizzle stores the transaction in the database and in the
>       transaction log.
>    3. Master extractor extracts the transaction and publishes it to RabbitMQ
>    4. Slave applier consumes the transaction from RabbitMQ
>    5. Applier transforms the transaction to JSON
>    6. Applier writes the JSON to a set of websockets
>    7. Javascript voodoo is performed to make it visible
> 
> Possible real usecases
> The demo app just shows what is possible, but a real use case could be
> that someone has a drizzle backed forum and want to add some real time
> post-updates to some front page somewhere. This would be real easy,
> simply start a new slave configured for WebSocket application (of
> course RabbitReplication is already used for other replication needs :)
> ), convert the JSON to something that makes sense and they are set! If
> someone has a cool usecase, please let me know and i'll build a more
> realistic demo app!
> 
> URL:
> http://developian.blogspot.com/2009/12/drizzle-replication-to-websockets.html
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~drizzle-discuss
> Post to     : drizzle-discuss@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~drizzle-discuss
> More help   : https://help.launchpad.net/ListHelp




References