今日深圳风彩开奖号:Complex Event Flows in Distributed Systems: Bernd Rücker Discusses Workflow Engines at QCon NY

| by Daniel Bryant Follow 712 Followers on Jul 08, 2018. Estimated reading time: 6 minutes | NOTICE: The next QCon is in San Francisco Nov 5 - 9, 2018. Save an extra $100 with INFOQSF18!

深圳风采开奖号码 At QCon New York, Bernd Rücker presented "Complex Event Flows in Distributed Systems", and cautioned that although event-driven architectures can be extremely powerful, it can also be easy to create complex and highly-coupled peer-to-peer event chains. He proposed that lightweight, open source workflow engine solutions provide many advantages for the business, developers and ops.

Rücker, Co-founder and developer advocate at Camunda, began the talk by stating that he wanted to discuss three common hypotheses that he encounters when working with customers (particularly focusing on microservice-based architectures): events decrease coupling; orchestration needs to be avoided; and workflow engines are painful.

A simple example e-commerce reference application was introduced that was based upon the concept of "one-click" ordering presented by the Amazon dash, where a customer simply presses the dash button and a corresponding item is ordered. The processing steps involved with such an e-commerce transaction involved: paying for the item; fetching the item; and shipping the item. Sketching out some simple bounded contexts for the example application, it was suggested that a checkout, payment, inventory and shipment context would most likely be involved in the transaction. In a microservices-based architecture the bounded contexts often map to individual autonomous services

For the first hypothesis -- events decrease coupling -- a discussion was presented on temporal decoupling by using events and read models. Events are facts about what has happened in the past, as opposed to commands which are empirical and have an intent about what needs to happen in the future. Rather than a service directly informing another of something happening, for example by request/response, having a service emit an event that any other service can listen for provides looser temporal coupling. This is typically accomplished by a move away from Remote Procedure Calls (RPC) technology, like REST or gRPC, towards using a centralised event fabric or distributed logging platform like Apache Kafka.

Using events can clearly decrease temporal coupling, but can also lead to the creation of complex peer-to-peer event chains. Quoting Martin Fowler, Rücker stated:

The danger is that it's very easy to make nicely decoupled systems with event notification, without realizing that you're losing sight of that larger-scale flow, and thus set yourself up for trouble in future years.

When using peer-to-peer event chains it can be challenging to modify the sequence of the underlying business processes without changing multiple services. This is because services typically have (implicit) knowledge of the before and after steps within the chain. Rücker likened this process to a three-legged race; it's possible to go fast, but coordination is required to prevent calamity. Accordingly, there are clear benefits to extracting -- and orchestrating -- the end-to-end responsibility for the corresponding business functionality (or application feature). Using commands, alongside events, can help to avoid complex peer-to-peer event chains.

Complex peer-to-peer event chains

For the second hypothesis -- orchestration needs to be avoided -- the discussion began around the benefits of smart endpoints and dumb pipes and shared some of the lessons the industry has learned from using heavy-weight (and proprietary) middleware like Enterprise Service Buses (ESBs). Quoting Sam Newman, Rücker cautioned the audience that it is easy for clients of dumb endpoints to become god services: "a few smart god services tell anemic CRUD services what to do". He also mused that a god service is only created by bad API design, and that a big challenge is presented with the handling of state associated with a (potentially) long-running business flow. The conclusion to this section of the talk was that there can be many benefits realised by not avoiding orchestration.

Discussion of the third hypothesis -- workflow engines are painful -- began by exploring the history of such tooling. Although many developers have bad experience of "no code" Business Process Modeling (BPM) frameworks, the first generation of such tooling tended to be overly-complicated, proprietary, centralised and developer adverse. The latest generation of workflow engines, such as AWS Step Functions, Uber Cadence and Netflix Conductor, has proven to Rücker that Silicon Valley has recognised the potential benefits of workflow engines when this technology is implemented correctly. There are also lightweight open source options such as Camunda, zeebe (also by Camunda), Activiti, and jBPM.

Expanding on his definition of "lightweight", Rücker presented several code examples using Java code written for the Camunda framework. A simple DSL was used to construct a workflow, which can also be visualised graphically using Business Process Model and Notation (BPMN), an ISO standard. The Camunda framework also allows the specification of a data store to manage state for long-running business flows. This means that a developer now has a state machine, in which it is easy to manage concepts such as time (for example, checking for a updated payment card in seven days time), and the construction of "composite", long-running executions that consist of many steps in the workflow. Referencing work that both Martin Schimak's and Rücker have contributed to (also additionally covered recently on InfoQ), he suggested that interested members of the audience read more about this within the original Domain-Driven Design (DDD) book by Eric Evans (see also the InfoQ "DDD Quickly" book), and explore "Event Storming", as described by Alberto Brandolini.

Many developers are now (sometimes implicitly) working on distributed systems, and this introduces complexity that has to be tackled; it is impossible to differentiate certain failure scenarios within a distributed system independent of communication style. It can be tempting to implement distributed transactions or patterns like two-phase commit, but Pat Helland's seminal paper "Life beyond Distributed Transations: an Apostate's Opinion" warns of the challenges associated with this. The Saga Pattern, introduced as "distributed transactions using compensation", was discussed, as was the associated tradeoffs with eventual consistency (and no isolation, as in ACID).

The penultimate section of the talk examined the use cases for workflow automation. Rücker stated that as much as he agrees with the DevOps philosophies, he prefers that term "BizDevOps", as this highlights better the importance of collaboration across all teams within an organisation. Lightweight workflow engines can help with all aspects of this concept: business processes can be explicitly discussed and understood; developers can leverage the state machine and workflow engine; and the processes can be operated with visibility and context.

Rücker stressed that workflows live inside service boundaries, and must not stretch across microservices (or bounded contexts). Having a single workflow solution orchestrating all of the services within a system can lead to high coupling, and was one of the fundamental issues with the first generation of BPM software. He also cautioned against "not invented here" syndrome, and stated that developers shouldn't attempt to create their own workflow engines when there are many good open source solutions.

Workflows live inside service boundaries

The final section of the talks reviewed the opening hypotheses. In regards to "events decrease coupling", the answer presented was "sometimes"; there is no denying the potential for loose coupling when using events, but it can be all too easy to create complex peer-to-peer events chains. For the second hypothesis, "orchestration needs to be avoided", the answer was also "sometimes"; instead of using complicated ESBs the smart endpoints and dumb pipes model should be chosen, but it worth remembering that important (cross-cutting) capabilities need a home. For the final hypothesis, "workflow engines are painful", Rücker suggested that "some of them are", but modern, lightweight, open source engines are easy to use and can run decentralised; they solve hard developer problems, but should not be custom implemented.

The slides for Bernd Rücker's QCon New York talk, "Complex Event Flows in Distributed Systems" (PDF), can be found on the conference website, and the video for this talks (and all QCon NY talks) will be released via InfoQ over the coming months.

Rate this Article

Adoption Stage

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Typo by Sasan Plus

Very good article. I'd be interested in more on command and event balance with close to real use cases. Also, 4th paragraph should read "events decrease coupling" instead of "events decrease decoupling"

Re: Typo by Daniel Bryant

Thanks Sasan -- I've written about Jonas Boner's thoughts on the subject previously: and I would also recommend having a look at Chris Richardson's work too: and!/book/microservice-patte...

Many thanks also for spotting the typo -- I've now fixed this.

Best wishes,


Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

2 Discuss

Login to InfoQ to interact with what matters most to you.

Recover your password...


Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.


More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.


Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

  • 小龙虾走俏催生新职业“品虾师” 2018-12-15
  • 女子痴迷鹿晗 商场门口对人形立牌拭泪亲吻 2018-12-14
  • 成都:共享办公受追捧 助力写字楼“去库存” 2018-12-14
  • 回复@老老保老张工:伪高工想回到那种你生产的产品再水都有人买单都不会倒闭的日子?没门儿! 2018-12-12
  • 习近平:深入实施创新驱动发展战略 为振兴老工业基地增添原动力 2018-12-12
  • 昆明母婴室地图出炉啦!公众场合喂奶不再羞答答 春城壹网 七彩云南 一网天下 2018-12-10
  • 南昌市新建区司法局深入湖区渔船宣传法律 2018-12-09
  • 银白配色更高贵-热门标签-华商网数码 2018-12-08
  • 超美雾凇冰挂奇观   豫北最大瀑布群变冰帘 2018-12-07
  • 台东“孩子的书屋”:撑起偏乡学童翻转命运的机会 2018-12-07
  • 实验室里“种植”钻石,这样的人造钻戒你能接受吗? 2018-12-06
  • 新赛季CBA联赛常规赛分组 吉、辽、深、广、青同组 2018-12-05
  • 【网络中国节】端午遇上足球杯 平陆交警夜查全力保平安 2018-12-05
  • 法学教育 要离生活更近些 2018-12-04
  • 写“平乐镇”前,小说家颜歌的光怪陆离 2018-12-03
  • 87| 934| 164| 761| 294| 924| 938| 657| 310| 152|