Is there way to organize sharding for camunda process instances?


#1

The topic speaks for itself. As I can see on forum, there is a statement ‘DB is always assumed to be centralized’ - is it still true?
Is it possible to use something like Citus with Camunda?
Are there any other ways to organize sharding?

Thanks in advance!


#2

Hi,

Heres a link to Zalando who use a sharding approach with impressive results…

regards

Rob


#3

@Webcyberrob, thanks for your reply!
Unfortunately, provided information is too high-level… Do they run multiple camunda instances? Does each instance run N process engines each linked to its own shard? How do they handle autoscaling in this case?

Thanks.


#4

Hi,

I believe an architecture they used was something like eight DB instances with say four engine nodes per DB instance. One pair was clustered for web requests, the other pair for job executor processing.

Given they had eight shards, to route to the correct shard, take something like the email address of the order and hash it down to a number from 0…7. Hence this determines which to route to.

They may have configured all eight engines on each node, as that means any node could handle any request, but Im not 100% clear if they did or didnt do this.

The above is my understanding of their architecture from a few years ago (it may have changed) and I gleaned this from presentation snippets (so I could get a few parts wrong)…

Perhaps an @zalando rep in the forum may comment with more authority…

regards

Rob


#5

Are you talking about scheme like this?
image

So each time I want to add new shard, I need to change Camunda configuration, add new PE and redeploy all instances… Can work with fixed number of shards, but we need solution which can scale automatically.


#6

Hi,
Yes thats essentially the architecture patter I was referring to. In terms of auto scale, you can horizontally scale out the engine nodes. Auto-sharding the DB tier is a little more challenging. However you can vertically scale the DB tier.

Thus as a hybrid, can you start with a fixed number of shards and combine horizontal autoscale and vertical scale when required on DB tier? AWS PaaS make this approach possible…

regards

Rob


#7

Hi,

Heres another interesting architecture approach based on AWS PaaS…

Set the number of shards to be fixed, eg 8
Use Elastic Bean Stalk to auto scale engine nodes up and down based on load
Use Serverless Aurora to autoscale the DB tier up and down.

So in summary, set the number of shards to be a reasonable. fixed size envelope. Use autoscale within shards to help optimise resource usage. (Note Aurora is not an officially supported Camunda tech).

regards

Rob


#8

Ok, that looks interesting. Thank you for your help!

We we also consider an option of scaling [camunda instance + db shard] pair though it looks a little bit more complex.


#9

Hi,

BTW - are you aware of Zeebe? This zeebe content may be of future interest…

regards

Rob


#10

Yes, I monitor Zeebe blog, but it is still beta, which is no-go for us.