Newby Question on Architecture - Where to store non-process related data?

Dear Camunda User Forum,

First congratulations to building such an amazing community. The amount of work you put into documentation (on website but also the stuff you find on YouTube, etc. is just awesome).

I am about to embark on a Camunda hobby project. I was coding quite a bit about 5-10 years ago, but after being stuck in non-coding related jobs for some time I decided it is time to build something - just for fun. Not only do I want to (re)-learn programming but I also want to get up to speed about architecture.

So I was thinking maybe someone in the community could give a bit feedback about my current thinking.

Some background information
System built: Order system for shipping wine, that needs to call several google APIs (e.g. places API to retrieve locations, addresses, phone numbers, etc.), assemble and print postage stamps, calculate prices for the wine, interface with 3rd party API to track shippment. etc.
Data stored: Customer data, Text that is put in the letter that goes with the shipment, etc.

Questions that I have:

  1. Should I go for this architecture where I have an own backend for “custom processing” stuff with an own database, where I store most of the data, and in the Camunda DB just store the minimum process variables. Basically when I hit a BPMN node I would use REST to orchestrate my custom Backend. For example REST call to assemble “print postage stamp”. The data is somehow distributed between Camunda DB and my custom DB.
  2. Or should I not build the “custom processing” backend and the Database and put everything in the Camunda Context - and code all the logic that I need to execute in the Camunda hooks, put all data into the Camunda DB. Here data is in one place.

I have the feeling that in a corporate setting where Camunda is deployed, architecture style 1) will be very common. Camunda models the task to open a banking account, but the fraud detection is done by a proprietary system that is called in some way from the Camunda BPM (e.g. REST). Is that the general way to go or is 1) a fact that is dictated by the need to interface

I hope that helps to get the discussion started. I would be very happy to get some feedback.

Best,
Panda

Your first option would be preferable.
Variables in camunda are best when considered to be snap-shots of what the data was for a give time in a given process. The source of truth for your data is always best externalized were it can be maintained independently of any process.

The only data you should consider storing camunda would be data which helps you route your process (i.e. VIP customers might take a different path) or data which helps you generate useful reports (e.g. country of origin may help you understand where most processes are being started).

Hope that’s useful.

1 Like

Thank you @Niall, this was very helpful!

Best,
Panda