Tips and Tricks on Building Event Driven Architectures with Windows Azure Service Bus

Just now I did a presentation at Visual Studio Live @ Redmond under the topic “Tips & Tricks on Building Event Driven Architecture with Service Bus”.

One of the very interesting things to understand is that a lot of us already use Event Driven Architectures even without knowing it. That was one of the parts I explained in the session, since a lot of us currently use messaging mechanisms to decouple our solutions, and that’s already building things in an event driven way.

A summary of the session for the people who didn’t attend is:

  • What is Event Driven Architecture?
    • Architecture Pattern that orchestrates behavior around:
      • Production
      • Detection
      • Consumption of events
    • Method for building decoupled enterprise solution
    • Suited for Async and unpredictable environment (like the cloud for example)
    • Has 3 types of processing:
      • Simple Event Processing
        • Events that are directly related to specific and measurable changes
      • Stream Event Processing
        • Events that can be notable (important) or ordinary (not so important)
      • Complex Event Processing
        • Both Notable and Ordinary events allowing to search for patterns


  • What is Windows Azure Service Bus?
    • Connectivity
      • Service Relay
      • Protocol Tunnel Eventing
    • Messaging
      • Queuing Pub/Sub
      • Reliable Transfer
    • Svc Management
      • Naming, Discovery
      • Monitoring
    • Integration Routing
      • Coordination Transformation


Going now for the Tips & Tricks

  1. Choose your Event Stream wisely
    • Messaging (Applicable when you need reliability)
      • Windows Azure Service Bus Queues
      • Windows Azure Service Bus Topics
      • Windows Azure Storage Queues
    • Relay (Applicable when you don’t need reliability but only a way to sent a message to all the subscribers)
      • NetEventRelayBinding
    • Twitter (Never forget the power of Twitter. For example provides you information about flight delays in US. Why not leverage Twitter to do the same for your app?)
    • RSS Feed (Also very interesting. For example Windows Azure Service Dashboard uses RSS Feeds.)
    • Other sources
  2. Create different types of messages, DON’T GENERALIZE IT
    • One of the important parts is never generalize event types.
    • You have 4 types of events you need to work on
      • Business
      • Execution
      • Lifecycle
      • Management
    • Those are the type of events but you shouldn’t generalize because each event has it’s own properties that are notable for them. For example a DataChangeEvent is different from a NotificationSentEvent. Do the two, don’t generalize into one only with different types.
  3. Choose the right Event processing Type
    • Simple Event Processing
      • Use it whenever you need to handle events in a simple way, without having differences between the events. You just need to process all of them.
      • Eg.
        • Coordinating Worker Roles
    • Stream Event Processing
      • Use this whenever you need to handle events in a simple way, but you have different types of events with different importance, like Notable and Ordinary events.
      • Eg.
        • Notification System that received events but some are priority notifications and other non-priority
    • Complex Event Processing
      • Use this whenever, and only, when you need to search for a pattern inside the event stream. if not, don’t use it.
      • Eg.
        • Stock Exchange. If the Index A goes up 20% and Index B goes up more than 5% in a 5 min period. Do Something
  4. Keep your modules Loosely-Coupled
    • Event Driven Architecture is all about decoupling every module of the solution, so continue with that. Do you modules as they don’t need to know who creates the events and why they do it.
  5. ‘Shard’ your Event Stream
    • It’s important to think from the start how you are going to shard your Event Stream, because if the solution is going to be unpredictable in growth you need to be prepared.
    • Some simple way is to think Sharding on the Type (Business, Execution, Lifecycle, Management) but then you can for further.
  6. Consider Windows Azure IaaS with Microsoft StreamInsight for Complex Event Processing
    • Very interesting product for Complex Event Processing and that can easily be placed in the Cloud, and of course Windows Azure Virtual Machines
  7. Consider ‘Project Austin’ from Microsoft
    • This is really good since it’s Microsoft StreamInsight as a Service in Windows Azure

I presented a sample based on this that can’t be found here

Also very interesting to check out is the new CQRS Journey from Microsoft Patterns & Practices here.

Hope this helps you in future developments, and also I’d love to hear you thoughts about this, so please comment and let’s build a conversation about it and generate other posts.

7 thoughts on “Tips and Tricks on Building Event Driven Architectures with Windows Azure Service Bus

  1. good post, just one question though … why not use StreamInsight? This is Microsoft’s product of choice for Event processing.

  2. Hi Ryan, glad you liked it. About your question you’re right StreamInsight is Microsoft’s product for event processing, but it’s much more about Complex Event processing. But you’re right you can use StreamInsight for everything. I actually talk about Stream Insight both in Windows Azure Virtual Machines and as a Service, since that should also be a great option.

  3. Great read. I am assuming with StreamInsight, besides CEP, one has to install and maintain it. With Windows Azure Service Bus, its just there for you as a scalable service to consume and let Azure take care of the burden of maintaining it. That way one is more productive concentrating on architecture, development or on anything else that involves building applications.

  4. While in the process of promoting beautiful Malaysia, here are also a few places one can consider visiting through the conducive and accommodative express bus . If you are Singaporean or a traveller coming from the Land of Merlion, you may take a bus Singapore to Johor Bharu and enjoy few popular destinations such as Desaru, Danga Bay, Kota Tinggi Waterfall and many more.
    If you are planning to skip Singapore, you may take a bus Singapore to Melaka and enjoy the heritage left by the Portuguese British and the mix culture of Baba and Nyonya.

    What if you’re coming from Langkawi, Kedah after an ideal beach holiday and you want to get back to Singapore in a safe and comfortable ride? Well you can still do so by just booking your bus ticket online from Kedah to Singapore. Just by a click on the mouse through the online website of , you can do your online booking of most express bus tickets from Singapore to Malaysia and within Malaysia itself. You can travel with the luxurious coaches during any time of the day. So save the hassle of going to the counters, pick your location, coach and get on the bus enjoying beautiful Malaysia

  5. Hi everyone,
    I found an easy way to travel,that is online purchase express bus tickets in Easibook.
    Let Check the bus service now!!
    Most popular trips are:
    1) Buses from Singapore to and fro Kuala Lumpur (KL), Malacca, Penang, Genting Highlands, Cameron Highlands, Ipoh, Alor Setar, Kuantan, Kota Bharu (Kelantan), Kuala Terengganu and Hatyai in Thailand.
    2) Buses from Cameron Highland to and fro Singapore, Busee from Genting Highland to Penang, and Singapore.
    3) Buses from Kedah to and fro Kuala Lumpur (KL), Johor, Singapore, Ipoh (Perak), Malacca (Melaka), Negei Sembilan, Perlis, Kelantan, Hatyai Thailand and various parts of Malaysia.
    4) Buses from Johor to and fro Kuala Lumpur (KL), Penang, Singapore, Ipoh, Malacca, Genting Highlands, Hatyai Thailand and various parts of Malaysia.

Leave a Reply

Your email address will not be published. Required fields are marked *