On Rabbits and Elephants. (or Using RabbitMQ to stream data events across PostgreSQL Databases)

Similar documents
A Double Edged Sword. December 10, Originally published March 15, 1996 in Web Review magazine.

Considerations for Mobilizing your Lotus Notes Applications

Azon Master Class. By Ryan Stevenson Guidebook #10 Google and YouTube Marketing

Cold, Hard Cache KV? On the implementation and maintenance of caches. who is

Azon Master Class. By Ryan Stevenson Guidebook #5 WordPress Usage

Rails + Legacy Databases Brian Hogan - RailsConf 2009 twitter: bphogan IRC: hoganbp

Version Copyright Feel free to distribute this guide at no charge...

MITOCW watch?v=flgjisf3l78

Close Your File Template

Arduino IDE Friday, 26 October 2018

OOoCon Marketing OpenOffice.org. by Nick Richards On rendezvous. Right here, right now.

Oracle Cloud. Content and Experience Cloud ios Mobile Help E

Manually Back Up Time Machine To External Hard Drives Too

You ve probably used your favorite Web browser for a long time. Your

We are assuming you have node installed!

MITOCW watch?v=0jljzrnhwoi

How to import, edit, AVI files? Posted by curmudgeon66-02 Dec :33

How to set up and customize your Mac from scratch

Instructions I Lost My Iphone 4 Password Yahoo

goo.gl/c86gv How to Create a Twitter Account a step-by-step tutorial

4s Instead Of Voice Control

AMP 007: The Mother s Day Marketing Playbook

============================================================================

Robert Ragan s TOP 3

Android Programming Family Fun Day using AppInventor

Amber Weyland: [to cameraman] Just hold it there so we can see Mollie.

Manually Sync Ipod Touch Itunes Wont Let Me Buy An Album

SLACK. What is it? How do I use It?

Double Your Affiliate Commissions with this VERY Simple Strategy

[PDF] SEO Copywriting Flow: Creating A Steady Stream Of Rankings & Conversions

TEST 5 A (Module 5) Vocabulary NAME:... DATE:... CLASS:... MARK: (Time: 40 minutes) Complete the words. 4 _ a d t s 2 _ u t n.

Export as DivX, Xvid, x264, MP4 Posted by DJKnuddel - 28 May :09

Instructions I Lost My Iphone Contacts While Sync >>>CLICK HERE<<<

PROFESSOR: Last time, we took a look at an explicit control evaluator for Lisp, and that bridged the gap between

How Do I Lock My Iphone 4 Screen While On A Call

6 Stephanie Well. It s six, because there s six towers.

Autoresponders using Mailchimp. Author List Management

Camtasia Studio 7 User Guide

Slick The Split:

WordPress is free and open source, meaning it's developed by the people who use it.

I'm Andy Glover and this is the Java Technical Series of. the developerworks podcasts. My guest is Brian Jakovich. He is the

INTRODUCTION. In this guide, I m going to walk you through the most effective strategies for growing an list in 2016.

Welcome to this IBM podcast, Realizing More. Value from Your IMS Compiler Upgrade. I'm Kimberly Gist

MITOCW watch?v=zlohv4xq_ti

Register FAQ Calendar Today's Posts Search

5 R1 The one green in the same place so either of these could be green.

How Do I Manually Lock My Iphone 4s A Hotspot Verizon

Yahoo Messenger Error Code 7 Latest Version

Notes to Accompany Debugging Lecture. Jamie Blustein

In today s video I'm going show you how you can set up your own online business using marketing and affiliate marketing.

Marketing Alliance Pre Built Funnel SWIPES..

Post Experiment Interview Questions

Business Data Communications And Networking Ebooks Free

It Might Be Valid, But It's Still Wrong Paul Maskens and Andy Kramek

Article Buddy User Manual

Blog post on updates yesterday and today:

Slide 1 CS 170 Java Programming 1 Testing Karel

BBC LEARNING ENGLISH 6 Minute English Wireless furniture for phones

Endless Monetization

Wow Voic Number Of Rings Iphone 4 >>>CLICK HERE<<<

Azon Master Class. By Ryan Stevenson Guidebook #7 Site Construction 2/3

In our first lecture on sets and set theory, we introduced a bunch of new symbols and terminology.

Oracle Cloud. Content and Experience Cloud Android Mobile Help E

Instruction How To Use Laptop As Monitor For Desktop Windows 7

Specialized Google Commands

Atlassian Confluence 5 Essentials

02. OBSERVER PATTERN. Keep your Objects in the know. Don t miss out when something interesting happens

Manually Sync Itouch Touch Itunes Wont Let Me Update My Music To My

ANALOGIES TO HELP EXPLAIN INBOUND MARKETING

MITOCW watch?v=4dj1oguwtem

Subscribe To The Blog Program in itunes Click Here

============================================================================

Java Programming. Computer Science 112

Using icloud's Mail rules to delete a message before you see it.

ShowMe Guides OpenCart 1.5 User Manual Ebooks Free

mismatch between what is maybe possible today and what is going on in many of today's IDEs.

IAE Professional s (02)

Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5

Ipod Manual Turn Off Voice Control My Mac

From time to time Google changes the way it does things, and old tutorials may not apply to some new procedures.


How To Manually Update Android Apps On Kindle Fire Hd Without Rooting

The following content is provided under a Creative Commons license. Your support

Understandable manual? Posted by Max Besser - 02 Feb :10

Iphone Instructions Sim Card Slot Stuck Wrong Way Round >>>CLICK HERE<<<

THE MAGIC OF A MILLION DOLLARS BY MAIL!

How I Made $10,000 from Passive Affiliate Income in One Month

How To Get Gadgets Windows Vista Faster On Laptop Run

LAYEN Looking After Your Every Need

Proprietary to PostgreSQL

Speech 2 Part 2 Transcript: The role of DB2 in Web 2.0 and in the IOD World

You just told Matlab to create two strings of letters 'I have no idea what I m doing' and to name those strings str1 and str2.

Hi Bob, I got this from my colleagues near the end of last week and unfortunately lost track of it in my inbox to send you.

HOW TO REGISTER FOR AND JOIN AN ASTTBC/BCIPI WEBINAR ( as painlessly as possible)

Kindle Paperwhite Manual Plugged In But Not

MITOCW watch?v=w_-sx4vr53m

How Often Should I Turn Off My Macbook Air

Instructions I Lost My Iphone Contacts After. Update >>>CLICK HERE<<<

The following content is provided under a Creative Commons license. Your support

CS144 Final Review. Dec 4th, 2009 Tom Wiltzius

Transcription:

On Rabbits and Elephants (or Using RabbitMQ to stream data events across PostgreSQL Databases)

Don't try this at home. (try it at work or at least on your laptop)

Use Cases Adding complexity to your environment Writing distributed map reduce algorithms in Erlang Ensuring data inconsistency between canonical data sources and data warehouses Impressing your hipster Ruby programmer friends Replace your Slony replication setup

What is RabbitMQ? (don t let the cloud based marketing deter you)

What is PostgreSQL? (just kidding)

Doesn't speak elephant.

Doesn't speak rabbit.

Step-By-Step Instructions 1. Install your Erlang on the machine you into intend to run your RabbitMQ broker on. My preference is for Erlang R14b2, which almost makes me think they name Erlang releases after Star Wars characters, but they don't. Erlang is not as fun as Debian is. It doesn't need to be a beefy machine but it should have enough ram that if you don't have an active consumer it won't run out of memory. 2. Install RabbitMQ. This is a multistep process involving black magic. Depending on your distribution you can either download a package, or if your *nix impaired there is a windows installer too. Oh and don't forget to install the management plugin. You can download the management plugin from the RqbbitMQ site pretty easy. After you have downloaded it you put it in the RabbitMQ plugins directory. Kind of makes sense doesn't it? 3. Go to the store and buy RabbitMQ in Action and RabbitMQ in Detail. What do you mean you can't? No pre-order either? Well there are plenty of good blogs on the intarwebs that have good information such as *cough* mine. Seriously though if you are crazy enough to follow my advice and get this far out of actual interest in the subject, make sure you verse yourself in the operation of and the flexibility that is RabbitMQ. 4. Install one of the following: pl/python, pl/perl, pl/ruby, pl/php, pl/pgsql and pg_amqp, or write your own damn addon in c using librabbitmq and then distribute it using the very cool pgxn service. Buoy only need this on the databases your going to be writing triggers on. Are you still reading this? Seriously? I would have thought I had lost you by now. Either that or you are skipping ahead because I should have changed the slide by now. It could be that Selena is operating the slides, in which case I have no control over these slides which is a terrifying thought. You see there is very little content on the slides, a real lack of substance. If I stay on any one slide for too long then you'll realize I really don't know what I am talking about and then I'd not be asked back to give one of the most important talks of the conference. 5. It's almost time to write your publisher, but don't get too far ahead of yourself. You first need to make sure that you have figured out a routing paradigm to use. Don't you like that word? Paradigm. I hear it in my head as para dig'um. Anyway, back to routing paradigms. Depending on your use case you will have the ability to broadcast your events to a whole slew of databases that care about what you have to send, or just one. You can implement a 1-to-1 type of scenario where a "direct" exchange is setup and your data will be queued in a way that no message is duplicated to your client and there is transactional guarantees in RabbitMQ. You probably don't want that thou, as you're a fly -by-the-seat-of-your-pants type of person, aren't you? For that you'll want to turn on noack mode in your consumers. Rabbit will just fling your messages to your consumers as fast as possible, just like an ape at a zoo and his favorite projectile. 6. This is where things get fun,. We are going to quite. Stored procedure in the language of your choice and have it publish to RabbitMQ using an exchange and a routing key, now at this point if you are still reading this, I have to question your sanity. This was a one off gag slide to make people at the conference think that I wax going to read all of this. Anyway, wirte your function that publishes and you are almost done. No seriously. Well not quite done because you still need the part that calls this function and then the consumer app that reads the data from RabbitMQ and then doe the actions in PostgreSQL that you want it to do. 7. Now, basically you're going to add after insert, update, delete triggers to the tables you care about. I'm. Not going to go into detail about how to do that since you are at a PostgreSQL. Conference and should know how to do that already. Instead I am going to assume you know what I am writing about and say that in these triggers you will want to call the function we wrote in step 6 from these trigger events, 8. Go to http://github.com/gmr/on-rabbits-and-elephants/ and download the sample code and use that instead of all of this nonsense.

Use a Trigger (benefit from the value of a trigger?)

Not that kind of trigger. (who s old enough to get the reference?)

Maybe this kind. (btw: google image search for footgun )

Really this kind. (pretty boring, I know)

Two roads diverged in a yellow wood, And sorry I could not travel both (yes I just quoted Robert Frost in a lightning talk and not a high-school valedictorian speech)

Blame Him (for pg_amqp)

"But wait, there's more!"

Message Routing.

Examples Publish to a single consumer/destination Publish to every consumer listening to redundant_locations.* Publish to every consumer listening to *.my_awesome_table

Consumerism at itsʼ finest.

Itʼs Wafer Thin

Do I have to? (yes, go get the code and do it, it works, I promise. if it doesn t I ll refund the licensing fee for the code.)

Resources rabbitmq: http://www.rabbitmq.com pg_amqp: easy_install pgxnclient USE_PGXS=1 pgxn install pg_amqp http://pgxn.org/dist/pg_amqp/ example code: https://github.com/gmr/on-rabbits-and-elephants follow me on twitter: @crad