DxTroy
EN
Contact

How I work

Microservices or Multi Database: a simpler way to grow a system?

Keep the application as it is and split only where the data lives: each Module sits in one database, while access rules and backups still cover the whole project.

Mr DxTroy4 min readFor CTO

Left: each area is its own service and builds its own sign-in, permissions, deployment and monitoring. Right: one system, only the data is split by Module.
Left: each area is its own service and builds its own sign-in, permissions, deployment and monitoring. Right: one system, only the data is split by Module.

For years, when a system grew, the usual answer was to split it into microservices. I've gone down that road. It's powerful, but it doesn't come cheap.

Microservices: powerful, but a lot of work

Before the first line of business code, you already have to answer:

  • How many services? Which parts get split off, which are shared?
  • When the system grows again, do you split further?
  • How do you upgrade, change the architecture, keep data in sync?
  • When services call each other, how do they authenticate and control the data?

Every answer brings architecture, coding, operations and testing work, from day one and for the whole life of the system.

One project, several databases

On Ebig, I tried something else: keep the application as it is and split only where the data is stored. I call it Multi Database.

  • Every project has a main database, main, which holds accounts, departments and permissions.
  • The Owner adds databases in Govern › Data storage and picks a shared pool to create them in.
  • On the Module page, you choose a Database for the Module and save. Each Module sits entirely in one database.
  • The access rules don't change: same sign-in, same permissions, whichever database the data is in.

No extra services, no changes to business code. The application, Workplace and the AI don't need to know where the data lives; only the data layer looks up the Module and opens the right database.

The video at the top records these steps on a test project, including backup and restore. Click a timestamp to jump to that step.

Backup and restore when data lives in several places

Once data is split across databases, the first question is: how do you back it up? On Ebig, the unit of backup is still the project, not each database.

  • One backup covers every database in the project. It's encrypted and records which Module lives in which database. Ebig backs up daily on its own; the Owner clicks Create backup when needed, for example before a large import.
  • Restore puts each Module back into its own database. While it runs, writes pause (reads still work). Ebig first takes a snapshot of the current data; if something fails midway, it puts that snapshot back.
  • Download: the Owner can download a backup as one compressed file, one record per line.
  • Keep another copy in a place of your own: add an Object storage connection (R2/S3) in Integrate › Connections and pick it under Copy backups to. Each finished backup is copied to that bucket.

On the test project in the video, more than 50 records in 3 databases were backed up in about a second. The restore took about 4 minutes, most of it waiting for writes already in progress to finish before replacing the data. On a bigger project, replacing the records takes longer; I haven't measured how much.

A restore replaces every record created or changed after the backup was taken. Attached files, the project's source code, APIs and connections are not in the backup; webhooks aren't sent again and workflows don't run again for the restored records.

Strengths

  • No extra services. No new services to write, no changes to business code. The application, Workplace and the AI stay shared as before.
  • Sign-in and permissions are built once. The access rules apply to every database; nothing is rebuilt per area.
  • Set up in screens that already exist. Add a database in Data storage, choose it on the Module page, save, and you're done.
  • Backups still cover the whole project. One backup holds every database; a restore puts each Module back where it belongs.

Weaknesses

  • The unit of splitting is the Module. No splitting by year, no splitting by user.
  • Once a Module has records, it can't move to another database. Choose where it goes before you load data.
  • One write across several databases isn't guaranteed to succeed or fail as a whole. Modules that are often written together belong in the same database.
  • At most 8 databases per project; today they all sit in the same shared pool.
  • A restore applies to the whole project; you can't pick a single Module or a single database.
  • Load: I haven't measured it. All of a project's databases still sit in the same shared pool; spreading load to other servers needs a second pool. This is work in progress.

Value for the business

Microservices solve the problem of splitting services, deploying them independently and scaling them part by part. Many needs to split are really about splitting data and access paths, not splitting development teams. In those cases, Multi Database gets the same result with less architecture and coding work.

As users grow, the bottleneck is often a single database. Splitting by Module lets you put a heavy group of data, sales for example, in its own database. A new database can be created in a different pool without changing the application.

Opinion and decision

If a system needs independent deployment, different technologies or its own operating lifecycle, microservices are still the right call. Otherwise, I split the data first and split services later, when it's really needed.

Good architecture isn't the one with the most parts; it's the one that solves the actual problem with the least complexity. I'll keep testing this approach on Ebig and share the measurements when I have them.

Do this week: list your system's Modules and circle the groups that are often written at the same moment, like orders and order lines. Each group is a candidate for its own database; anything you're unsure about stays in main.

You can try it, or watch the videos of me trying it

Four screen recordings. Project setup is recorded in a single take; in the AI clips, the wait for the AI's answer is sped up.

Setting up a projectFrom a company name to more than 80 processes ready to use.
Using WorkplaceThe Today screen: tasks due, items waiting for approval and meetings in one place; then switching to This week.
Editing in EbigOSDescribe it in plain words, and the AI drafts a process for the person with authority to approve.
AI assistantAsk about a process in plain words, and the assistant answers from the company's data.

DataInfrastructure

Start with the slowest job.

One specific job. I assess it, propose a first step, then help you put it into use.