Messaging is not just for
    investment banks!
(+ web is not the only way)
                      Gojko Adzic
            ...
Web is now ubiquitous
... we use it to display content, to share data, for
 remote procedure calls, to integrate systems...
It started like this...
And simply exploded...
But why this???
HTTP distribution/integration

    Easy to use

    Cross-platform

    Clustering and load balancing

    Almost neve...
Web technologies are not for
         everything...




... sometimes other stuff can save a lot of effort
            htt...
HTTP distribution/integration

    Easy to use

    Cross-platform

    Clustering and load balancing

    Almost neve...
Messaging

    Application integration pattern

    Data transformation, routing, resilience, high
    performance, high...
http://www.flickr.com/photos/wirenine/
http://www.flickr.com/photos/17675967@N02/
http://www.flickr.com/photos/stewf/
Messaging

    Application integration pattern

    Data transformation, routing, resilience, high
    performance, high...
Not just for multi-billion enterprises
                     
                         Some really
                       ...
Benefits

    Better isolation
    −   Easier scaling
    −   Better performance

    Resilience

    Responsiveness

...
Case Study #1: E-mail after
    registration/order
Case Study #1: E-mail after
    registration/order
Case Study #1: E-mail after
    registration/order
Case Study #1: E-mail after
    registration/order
Problems

    DNS/Networking issues

    SMTP rules (external verification, spam filters)

    How do we test this?

 ...
An alternative approach
An alternative approach
An alternative approach
An alternative approach
An alternative approach
Why is this better?

    External system problems don't affect user
    registration

    SMTP rules don't slow it down
...
Key Difference:



The first part of the process succeeds
    without waiting for the second
  - but the second is guarant...
Transactional guarantee
How do we test this?

    Mock queue/In memory implementation

    Process registration and look at the queue
    conten...
Publish/Subscribe (Fire & Forget)




         http://www.sxc.hu/photo/1084274
Publish/Subscribe (Fire & Forget)

    When you need to talk to external systems but
    don't really need to wait for th...
Case study #2: Credit card
       processing
Case study #2: Credit card
       processing
Case study #2: Credit card
       processing
Case study #2: Credit card
       processing
What could possibly go wrong?

    User closes the window mid-way

    User clicks on refresh

    Web call times out
...
On top of that, we're wasting web/db
             resources!
Alternative solution
Alternative solution
Alternative solution
Alternative solution
Alternative solution
Alternative solution
Alternative solution
Alternative solution
Alternative solution
Alternative solution
What's improved?

    Closing the window makes no difference

    Refresh makes no difference

    Web call will not ti...
Some ways to improve this...

    Enqueue operation result, authorise order
    asynchronously (increase resilience)

  ...
Some other situations where
    messaging might come in handy

    Distributing work across multiple machines

    Perfo...
Tools

    ActiveMQ: http://activemq.apache.org/

    NServiceBus: http://www.nservicebus.com/

    AMQP: http://amqp.o...
Bridging the Communication Gap

    learn how to improve communication
    between business people and software
    imple...
Messaging is not just for investment banks!
Upcoming SlideShare
Loading in...5
×

Messaging is not just for investment banks!

598

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
598
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
17
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Messaging is not just for investment banks!

  1. 1. Messaging is not just for investment banks! (+ web is not the only way) Gojko Adzic http://gojko.net gojko@gojko.com twitter.com/gojkoadzic
  2. 2. Web is now ubiquitous ... we use it to display content, to share data, for remote procedure calls, to integrate systems...
  3. 3. It started like this...
  4. 4. And simply exploded...
  5. 5. But why this???
  6. 6. HTTP distribution/integration  Easy to use  Cross-platform  Clustering and load balancing  Almost never blocked by firewalls  Even then works with proxying  Stateless  Synchronous  Unreliable/Non transactional  High latency
  7. 7. Web technologies are not for everything... ... sometimes other stuff can save a lot of effort http://www.flickr.com/photos/33453508@N02/
  8. 8. HTTP distribution/integration  Easy to use  Cross-platform  Clustering and load balancing  Almost never a security problem  Even then works with proxying  Stateless  Synchronous  Unreliable/Non transactional  High Latency
  9. 9. Messaging  Application integration pattern  Data transformation, routing, resilience, high performance, high throughput  Message oriented middleware(MOM)
  10. 10. http://www.flickr.com/photos/wirenine/
  11. 11. http://www.flickr.com/photos/17675967@N02/
  12. 12. http://www.flickr.com/photos/stewf/
  13. 13. Messaging  Application integration pattern  Data transformation, routing, resilience, high performance, high throughput  Message oriented middleware(MOM)  Event driven processing  Split workflows into several asynchronous parts  Share data instead of functionallity − But use data to invoke actions!
  14. 14. Not just for multi-billion enterprises  Some really lightweight solutions out there  Can even run everything on a single machine  Typical web sites can benefit from this approach as well
  15. 15. Benefits  Better isolation − Easier scaling − Better performance  Resilience  Responsiveness  Better resource usage
  16. 16. Case Study #1: E-mail after registration/order
  17. 17. Case Study #1: E-mail after registration/order
  18. 18. Case Study #1: E-mail after registration/order
  19. 19. Case Study #1: E-mail after registration/order
  20. 20. Problems  DNS/Networking issues  SMTP rules (external verification, spam filters)  How do we test this?  How do we guarantee that the message gets through? − What if it doesn't  What if the DB rolls back?
  21. 21. An alternative approach
  22. 22. An alternative approach
  23. 23. An alternative approach
  24. 24. An alternative approach
  25. 25. An alternative approach
  26. 26. Why is this better?  External system problems don't affect user registration  SMTP rules don't slow it down  If e-mail sending fails, we can easily re-send later
  27. 27. Key Difference: The first part of the process succeeds without waiting for the second - but the second is guaranteed to happen
  28. 28. Transactional guarantee
  29. 29. How do we test this?  Mock queue/In memory implementation  Process registration and look at the queue contents  Easily unit testable  Focuses the test on what is really important
  30. 30. Publish/Subscribe (Fire & Forget) http://www.sxc.hu/photo/1084274
  31. 31. Publish/Subscribe (Fire & Forget)  When you need to talk to external systems but don't really need to wait for them to finish  Batch/overnight processing  Decouple processes so that they can be performed asynchronously  Effectively observer over messaging  Option to have multiple subscribers (observers)
  32. 32. Case study #2: Credit card processing
  33. 33. Case study #2: Credit card processing
  34. 34. Case study #2: Credit card processing
  35. 35. Case study #2: Credit card processing
  36. 36. What could possibly go wrong?  User closes the window mid-way  User clicks on refresh  Web call times out  CC channels too busy/RPC times out  Order processing fails after authorisation
  37. 37. On top of that, we're wasting web/db resources!
  38. 38. Alternative solution
  39. 39. Alternative solution
  40. 40. Alternative solution
  41. 41. Alternative solution
  42. 42. Alternative solution
  43. 43. Alternative solution
  44. 44. Alternative solution
  45. 45. Alternative solution
  46. 46. Alternative solution
  47. 47. Alternative solution
  48. 48. What's improved?  Closing the window makes no difference  Refresh makes no difference  Web call will not time out  We can wait for CC channels  Web and DB resources used much better
  49. 49. Some ways to improve this...  Enqueue operation result, authorise order asynchronously (increase resilience)  Scale to more servers  Process cards using dedicated servers (VLAN)  Avoid polling, send a message to the client
  50. 50. Some other situations where messaging might come in handy  Distributing work across multiple machines  Performing a number of actions when something happens (eg notify admin, notify customer)  Pushing frequent updates to clients
  51. 51. Tools  ActiveMQ: http://activemq.apache.org/  NServiceBus: http://www.nservicebus.com/  AMQP: http://amqp.org
  52. 52. Bridging the Communication Gap  learn how to improve communication between business people and software implementation teams  find out how to build a shared and consistent understanding of the domain in your team  learn how to apply agile acceptance testing to produce software genuinely fit for purpose  discover how agile acceptance testing affects your work whether you are a programmer, business analyst or a tester  learn how to build in quality into software projects from the start, rather than control it later http://www.acceptancetesting.info
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×