# Using existing database as a single source of truth

**URL:** <https://forum.flowable.org/t/using-existing-database-as-a-single-source-of-truth/6649>\
**Category:** Uncategorized\
**Created:** [September 2, 2020, 11:50am UTC](https://forum.flowable.org/t/using-existing-database-as-a-single-source-of-truth/6649 "2020-09-02T11:50:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![deepak](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@deepak](https://forum.flowable.org/u/deepak)\
**Post date:** [September 2, 2020, 11:50am UTC](https://forum.flowable.org/t/using-existing-database-as-a-single-source-of-truth/6649/1 "2020-09-02T11:50:55Z")

</div>

Flowable folks,

We’ve an existing CQRS module in which we want to use flowable as an embedded engine but we don’t want to store the state in a separate flowable database(RDBMS) as we’ve cassandra as an event store(single source of truth). Is it possible in flowable to load/store state from/in existing database i.e. if i construct state using events in my event store and provide it to flowable engine somehow, will it be possible to execute workflows including timer tasks etc?

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [September 7, 2020, 11:36am UTC](https://forum.flowable.org/t/using-existing-database-as-a-single-source-of-truth/6649/2 "2020-09-07T11:36:05Z")

</div>

Theoretically it is possible. The whole data layer is pluggable and you can populate the data from any other system (however, do take in account you’ll be losing transactionality for some systems). However, as the feature-set of Flowable is big. this means a lot of work to be able to support all use cases and provide all data.

---

<div class="post-metadata">

**Author:** ![deepak](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@deepak](https://forum.flowable.org/u/deepak)\
**Post date:** [September 15, 2020, 12:29pm UTC](https://forum.flowable.org/t/using-existing-database-as-a-single-source-of-truth/6649/3 "2020-09-15T12:29:58Z")

</div>

Hi Joram,

Thanks for the insights! The problem is that if we want to embed flowable in an existing microservice, we now have 2 databases - 1 for the existing stuff and another for the flowable.

---

<div class="post-metadata">

**Author:** ![PHH](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/phh/32/94_2.png) [@PHH](https://forum.flowable.org/u/PHH)\
**Post date:** [September 15, 2020, 5:09pm UTC](https://forum.flowable.org/t/using-existing-database-as-a-single-source-of-truth/6649/4 "2020-09-15T17:09:19Z")

</div>

If the microservice DB is supported by Flowable, then you can share the same DB. If the microservice DB is something like Cassandra or another unsupported DB, you will need 2 DBs. Or you could write and contribute a data source connector, like we have for MongoDB and CockroachDB - but it does need to be a data source that supports transactions.

Cheers  
Paul.

---

<div class="post-metadata">

**Author:** ![deepak](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@deepak](https://forum.flowable.org/u/deepak)\
**Post date:** [September 16, 2020, 4:10am UTC](https://forum.flowable.org/t/using-existing-database-as-a-single-source-of-truth/6649/5 "2020-09-16T04:10:03Z")

</div>

Thanks a lot PHH!

I’ll try to find a solution for the same. If that works i’ll definitely share it.
