# Multiple clusters for the same application, memory backend, and RPC layer

**URL:** <https://forums.foundationdb.org/t/multiple-clusters-for-the-same-application-memory-backend-and-rpc-layer/2685>\
**Category:** Using FoundationDB\
**Created:** [May 1, 2021, 12:10pm UTC](https://forums.foundationdb.org/t/multiple-clusters-for-the-same-application-memory-backend-and-rpc-layer/2685 "2021-05-01T12:10:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amirouche](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/amirouche/32/2096_2.png) [@amirouche](https://forums.foundationdb.org/u/amirouche)\
**Post date:** [May 1, 2021, 12:10pm UTC](https://forums.foundationdb.org/t/multiple-clusters-for-the-same-application-memory-backend-and-rpc-layer/2685/1 "2021-05-01T12:10:48Z")

</div>

I am investigating how to design an application as a monolith code base, with roles instead of services (or microservices), and in particular replace memcached and REDIS with FDB using the memory backend.

Since [createCluster](https://apple.github.io/foundationdb/javadoc/com/apple/foundationdb/FDB.html#createCluster-java.lang.String-) is deprecated, it is not possible anymore to connect to two different FDB clusters from the same POSIX processus. One way to workaround that, is to have a separate processus, that connects to the other cluster, hence it requires coordination between the different process, which is more difficult, hence error prone.

Use case: I want my application to work as a single process in dev setup, and offer an easy path forward web-scale. So that there is really 1 + 1 + 0.5 infrastructure knowledge and effort required to develop and operate the whole application. Here is how I came up with the previous computation:

- One unit of effort and knowledge invested into the monolith with roles code base
- One unit of effort and knowledge invested into FDB using SSD backend
- Half a unit of effort and knowledge invested into FDB using memory backend to take into account specifics about the memory backend (if any!)

I gave a some context to help decide whether it is interesting to be able to access different clusters from the same processus (I think it does). There may be other use-cases, I am not aware of (chime in!).

It seems the [RPC Layer](https://github.com/apple/foundationdb/wiki/FoundationDB-RPC-Layer-Requirements) is the future.

- Can it be confirmed that the RPC Layer will be another POSIX processus that should be deployed along side the FDB cluster?

- What is the plan regarding developer setup? NB: I prefer to avoid the need for an FDB or RPC Layer emulator.

- Will the future setup with the RPC layer support access from a single process multiple clusters?

---

<div class="post-metadata">

**Author:** ![ajbeamon](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/ajbeamon/32/13_2.png) [@ajbeamon](https://forums.foundationdb.org/u/ajbeamon)\
**Post date:** [May 3, 2021, 5:51am UTC](https://forums.foundationdb.org/t/multiple-clusters-for-the-same-application-memory-backend-and-rpc-layer/2685/2 "2021-05-03T05:51:12Z")

</div>

> [@amirouche](#):
>
> Since [createCluster](https://apple.github.io/foundationdb/javadoc/com/apple/foundationdb/FDB.html#createCluster-java.lang.String-) is deprecated, it is not possible anymore to connect to two different FDB clusters from the same POSIX processus.

You can use `FDB.open()` multiple times in the same process to connect to different clusters.
