API Maker

The framework for AI era

Level 1 · StartArchitecture 02 of 13

Separate database server

API Maker on one VPS, your databases on servers of their own.

The first split most teams make: each database gets its own CPU, memory and disk, stays off the internet and grows on its own. API Maker reaches it over the private network, along with any database you already run.

See it live

Every request is drawn as it travels. Slow it down, pause, go step by step, or open the full canvas and zoom in.

api-maker/architectures/separate-databaseLive
  • Request
  • Response
  • Write
Servers
4VPS + yours
Databases
3connected
Capacity
~2,759req/s
Orders DB
0%CPU

Your data gets servers of its own. Each database moves to a VPS sized for it. API Maker finds it again with a new connection string: no API changes.

How it works

The same steps as the diagram, in more detail.

  1. Your data gets servers of its own.

    Move each of your databases to a VPS of its own, sized for its data: more memory for its indexes, fast NVMe disks for its writes. In API Maker only the connection string of the instance changes, from 127.0.0.1 to the private IP of the new server. Every generated API, custom API and schema keeps working as it was.

  2. Databases stay off the internet.

    The apps only ever reach API Maker. The database servers accept connections from the private IP of the API server alone, so their ports are closed to the internet. API Maker applies authentication, roles and field level access before any query reaches them, and keeps a pool of connections to each database.

  3. One call, several databases.

    API Maker speaks to all 8 database types at once. With deep populate, one request reads orders from PostgreSQL and fills in their products from MongoDB, across servers and database types. The apps get one response and never need to know where each part of the data lives.

  4. Resize the database on its own.

    Each server grows on its own schedule. When the orders database gets busy, resize its VPS: the database restarts, API Maker reconnects on its own, and the API server is never touched. Later, the database can become a cluster of its own, as the Resilient architectures show.

  5. Bring the databases you already have.

    A database does not have to move to get APIs. Connect API Maker to the SQL Server of your ERP in your own data center, through a VPN or an SSH tunnel, and it generates the APIs of every table without changing the database. Old and new data are served side by side, by the same API layer.

Why choose this architecture

Resources of its own

The database gets its own CPU, memory and NVMe disk. Heavy queries never slow down the workers of API Maker.

Off the internet

Database ports open to the API server only. Every request passes the auth, roles and field level access of API Maker first.

Grow each tier on its own

Resize the database server without touching the API server, and the other way around.

Many databases, one API

PostgreSQL, MongoDB, SQL Server and 5 more types, on any servers, joined in one call with deep populate.

Keep what you have

Generate APIs for databases you already run, even in your own data center, without migrating them.

Simpler operations

Back up, restore and patch each database on its own schedule, with the tools made for it.

Server configuration

Plain VPS from any provider, or your own servers, with Ubuntu 22.04 LTS. Sizes are a starting point: measure and adjust.

API server

×1
CPU
2 – 4 vCPU
Memory
4 – 8 GB
Storage
40 GB SSD

Runs

  • API Maker backend, cpuCount AUTO
  • Admin panel
  • Docker: sandbox containers of custom code
  • MongoDB 6 replica set: data and logs of API Maker
  • Redis 7: internal and cache

Ports

  • 38246: HTTP APIs
  • 38245: WebSocket
  • 4626: admin panel, your IPs only

Database server

1 per database
CPU
4 – 8 vCPU
Memory
16 – 32 GB
Storage
200 GB+ NVMe

Runs

  • One of your databases: PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, MongoDB, TiDB or Percona
  • Its own backups and monitoring

Ports

  • 5432, 3306, 27017…: from the API server only

Give it enough memory to keep the indexes you query most in RAM.

Connection strings of the instancesAdmin panel → Instances
# Instance "orders": PostgreSQL on VPS 2, over the private networkpostgres://api_maker:***@10.0.0.21:5432/shop# Instance "catalog": MongoDB on VPS 3mongodb://api_maker:***@10.0.0.22:27017/catalog?authSource=admin# Instance "erp": the SQL Server you already have, through a VPNServer=10.8.0.2,1433;Database=erp;User Id=api_maker;Password=***;

Only the connection string changes when a database moves: every API stays the same.

Firewall of a database serverterminal
# On VPS 2: only the API server may reach PostgreSQLufw default deny incomingufw allow sshufw allow from 10.0.0.10 to any port 5432 proto tcpufw enable

Good to know

  • Still one API server: when it stops, the apps stop. The next architectures add more of them.
  • A network hop between API Maker and each database: keep them in the same data center, on the private network.
  • More servers to patch, monitor and back up.
When you outgrow itYou want the API server itself to hold nothing, ready to be replaced or joined by others. Dedicated data tier

Questions

Do my APIs change when the database moves?

No. Only the connection string of the instance changes. Generated APIs, custom APIs, schemas and permissions stay exactly the same.

Can API Maker connect to a database I already have?

Yes. Point an instance at any of the 8 supported database types, on any server API Maker can reach, and it generates the APIs of its tables without changing the database.

How does custom code reach a database on another server?

Custom code runs in Docker sandbox containers. When the database address is different from inside a container, set the sandbox connection string of the instance: it is used from the sandbox only.