How camunda stores its database?

Hello Folks,
I have been given tasks to replicate cockpit into an Web application, so i took approach of API’s,
While thinking that would be ok to get all information of the current processes and tasks and performing operations via REST API’s,
Or should i access the database of the camunda as of where it is storing the data when i am creating new process via API or by the Camunda UI of cockpit,

How should i approach??

Key points to consider:

  • I will be running my app under proxy server.
  • Already using Camunda 7.5.0 with apache-tomcat-8 (apache/coyote1.1).
  • Will CORS be required??

So, if i am approaching by database which is mySql it seems,
So how should i approach towards the queries.
as i read camunda docs, there it is not given as to how Camunda stores processes of a deployed web-app into database. and how can i perform SQL queries into that database.

Thanking in Advance
Shohil Sethia

1 Like

Hi @Shohil_Sethia,

Using the REST API is the way to go. Querying the Camunda database all by yourself will be a painful experience if you are planning to build a real-world application. If you want to save the REST API access, you could consider using an embedded process engine that hits the Camunda database directly.

It appears that you are at the start of a project. Based on your last question I think that you already tried using the REST API but are struggling. I also have the feeling that these struggles come from the complexity of your application architecture (frontend, backend, Camunda integration, server/proxy setup). Note that we are not able to assist with sorting such general issues out as this is a very time-consuming task. We prefer to invest this time in developing new Camunda features that all users benefit from.

As a general advice, try to make a step back and understand each of the components on their own. For example regarding Camunda REST API integration and proxies/CORS, write a minimal (non-angular, non-custom backend) Javascript application that works. If you get this working, add the other components one-by-one in. If something breaks in that process, try to understand how your setup has changed and in which component you’ll have to change something.

Cheers,
Thorben

5 Likes

Hi @thorben
Actually i have been this task to replicate only the cockpit module of Camunda as a separate Web application.
Therefore my mentors gave me two choices:

  1. Either to follow with REST API
  2. Or try to understand how camunda is storing the process-definition and tasks at the backend to query it from there and replicate those tasks and Process-definition outside camunda-cockpit as an external Web-Application

Therefore i am trying to understand the database concept as to how to set it up to execute SQL queries to Camunda Cockpit.??

Thanking in Advance
Shohil Sethia

Hi Shohil Sethia,

Camunda stores its data in a regular relational database. You can use JDBC and an appropriate driver to connect against this database, then query any data you like. I’m cannot help you with setting up a JDBC connection, there are plenty of tutorials on the web. If you have questions on the Camunda database schema, we may give you some hints. However, we won’t be able to provide you with a detailed description of what each table and attribute means.

Lastly, I still think querying the database directly is not what you should do. Embed a process engine in your application instead or use the REST API. The Camunda documentation is extensive on both of these topics. Try to read and understand it. If something is not clear, ask for clarification by directly linking the section you do not understand. Explain what you understood and what not.

Cheers,
Thorben

1 Like

Thank you @thorben
I will try to embed process-engine in my Web-app and will get back to you if faces any queries regarding camunda.

Thank you soooo much.
Cheers
Shohil Sethia

hi @thorben
As you said suggested to include a process-engine into my web application ,
Since the set-up and embed process given there is in the form of spring-framework,
So how should i approach that since i am developing in NodeJs-express appication.
How should i start ??

Thanking in advance
Shohil Sethia

Hi Shohil Sethia,

If the backend of your application is not written in Java or a JVM language that integrates with Java code (Groovy, scala, etc.), then you cannot use the embedded engine approach. The Camunda embedded engine API is Java only.

Cheers,
Thorben

1 Like

thankyou for replying @thorben
Then i think REST api is only option i have got since i am totally not aware of JAVA and its spring framework. :pensive:

1 Like

I think that is the right decision.

1 Like

thankyou for replying @thorben
I think there is a solution ,there has been approaches to do connection between nodeJs and jdbc
Here is the link:


What do you think ?

Thanks in advance
Shohil Sethia

Hey,

I think this is not going to help integrate a nodejs application with the Camunda Java library. From a node.js application you can use any technology to access the relational Camunda database. That is unrelated to JDBC, JDBC is just the way you do it if you are in a Java environment.

However, and that is why I do not recommend accessing the database directly, you need to understand the database schema and its contents if you go down this route. This is not a trivial task. This is not public API and can therefore change with any future release. Using the REST API, you do not have to worry about this as these things are handled by the REST API.

Cheers,
Thorben

1 Like

thanking for reply @thorben
I am asking my mentors putting up this condition as to which way should i proceed,
if they agree to NodeJs then i will go with REST api and if i wish it could be Java then i will start learning Spring framework with maven dependencies as given in Camunda project setup in Docs.

Thank you @thorben
Regards
Shohil Sethia

Hi @thorben @system @Zelldon @Ajr @nvanbelle
Since I am new to java,
So is there a way i can view the tabular scheme(Table-structure) of process-definition,task or process-instances created in camunda-cockpit and are currently running. ??
Kindly guide with any starting point

Regards
Shohil Sethia

Hi,

use a SQL Client like DBeaver and connect to your database.
With the help of your SQL client you can check the current database and all existing tables.
Another aproach could be to check the SQL create scripts from the process engine, see here.

Greets
Chris

1 Like

Thank you for Replying @Zelldon
I am trying to connect camunda process engine from Microsoft SQL server.
Is there any tutorial which i can follow to configure the database name ,username , password details in order to connect to the database.
Any leads would be appreciable.
Thanking in Advance.

Have a look at https://docs.camunda.org/manual/7.5/user-guide/process-engine/database/ also.

2 Likes

Have you tried checking the most logical place for these settings; the server configuration?

apache-tomcat-xxx > conf > server.xml > <Resource name=“jdbc/ProcessEngine” …

1 Like

ht @nvanbelle @langfr @Zelldon @thorben @system
Thanks for guiding,
I had a look on server.xml
It seems ‘Camunda’ uses" h2" connection database .
So i am trying connecting to “h2” database via “Dbeaver” via establishing connection of “h2” type,
The below fields occur


Port given = 8005 (as per server.xml)
What should i give in “host” and “Database/Schema” ?
Does host means “url” ?? or the “name” ?
And will the schema means driver type ??
Thank you
Shohil Sethia

1 Like

You do not need dbeaver. Camunda h2 comes with the web interface.
Just go to http://localhost:8080/h2/h2 . Default username and password (sa/sa).

If it does not work it might be the application is undeployed or disabled on your server. Check for camunda-h2-webapp-7.x.0.war.

Also note that h2 is not advised for running in production.

2 Likes

Hi @nvanbelle
Thanks for replying,
The UI of
H2
I can successfully login into that.
But now as i am trying to execute queries as per this document:

For example:
i am trying SELECT NAME_ FROM ACT_RE_PROCDEF;
It is showing:

Am i doing something wrong?
My motive is to be able to view the schema of each and everything in cockpit like: process-definition (ex:invoice) , task, etc. Everything to be viewed as tabular scheme just as shown in:

Am i doing something fundamentally wrong.?
Or is it that i can only view it from Database client like Dbeaver or others??

Thanking in Advance for precious help
Regards
Shohil Sethia