Five Things to Know About Your Camunda Production Environment
Background
The single environment approach is pervasive in legacy systems like IBM, Pega, Appian, etc. In these systems, a single environment is used for all of your BPMN applications. There's a single logging system to maintain, a single integration layer, and single UI layer, etc.
In other words, its monolithic. Everything gets deployed there. It's simpler to deliver to, simpler to maintain, and requires less interdepartmental jujitsu to reach the databases, environments, etc., that you need.
But this sort of thinking doesn’t work with Camunda and can end up painting you into a corner. This article will explain how to break old paradigms in order to unlock new potential.
Problem Statement
It’s difficult to know how the Camunda Production environment should be built. You have two basic options to start with.
The first one is what this article will refer to as the “Big Machine”: a single environment to house all of your process applications. The second one will be referred to as a “Micro Machine”, which assumes that every Camunda application gets it’s own server. There is also a middle ground, which will be referred to as a “Fractional Big Machine”, which supposes that multiple Applications will share a Camunda Server. For the purposes of this paper, the Fractional Big Machine and the Big Machine have the same challenges.
Problems with the Big Machine
The Solution, Build Micro Machines
Every Camunda Application should have its own environment, preferably as a Clustered Spring Boot Application. These can be a cluster of one or bigger clusters. Do not build a single monotheistic environment. This is not going to solve your legacy BPM problem. At best, it’s going to move your legacy BPM problem into the cloud but leave it essentially unchanged. That is the opposite of what you need.
Camunda’s literature calls this the micro-machine, where each node only has one application, but there is a shared database, as in Fig 1.
Fig 1
I’d go a step further and actually give each application its own database, as in Fig 2.
Fig 2
Optimization Each application
Camunda is designed to be optimized per application. For example: by configuring the Job Executor Thread or configuring External Tasks. The problem is, the heuristics for those optimizations have to do with the nature of your process. Elements such as
When you cram all your processes onto a single-engine; optimization, by nature, focuses on the lowest common denominator, which is the absolute opposite of what optimization is designed for. Worse, you'll only get slower and less performance over time since the working model requires making a bad situation worse by adding in new models.
Utilizing the single server approach, risk often arises with competing areas. For example, the Invoice Process can't take advantage of the new features of Camunda 7.15 because the Accounting Department doesn't want to risk the steady flow of business that they are experiencing. Both have a legitimate, sincere argument, but they are now in conflict because the architecture has been technically structured. This issue is entirely avoidable and should be.
Customize Resource Constraint
Standing up multiple instances may seem daunting with limited resources, but it's just a different way of doing the same task.
For example, it's the difference between serving off the countertop or having a bunch of small plates. The surface area is the same.
The net amount of memory, compute, etc., is essentially the same. Scaling a given application horizontally without having to scale *every* application horizontally, so you're setting yourself up to save resources. We generally recommend having a clustered Spring boot application for each process, even if it's a cluster of one running on a container, along with a DB clustered to support each one.
Embrace Reusability
When you reuse a process, you've reused the BPMN definition: not its instance. So you can have and reuse a library of shared assets that are deployed to each machine so that you still get reuse, but not at the expense of flexibility. This gives you the benefits of reusability without saddling you with its negative side effects.
Conclusion
Camunda BPM applications are meant to be customized, optimized, scaled, and managed on a per-application basis. Any other usage is unnatural and bound to paint you into a corner. When you start hearing people complain about how the multi-tenancy tables aren’t working as expected, or that the performance can’t be boosted with horizontally scaling, you know you’re headed down a dark path. We invite you to step into the light and do it the easy way.
Insightful article Max Young . I agree with the point of having single cluster per workflow, however the challenge I see is cost. Camunda's cloud will be an expensive affair having individual clusters for individual workflow. I assume this is because Camunda may be using EC2 instances behind the scene to host these workflows, how about containerized model ? Does Camunda cloud has that option so I don't eat up cost & still get separation of concern ?