API Maker

The framework for AI era

Level 1 · StartArchitecture 01 of 13

All-in-one server

API Maker, its MongoDB, Redis and your database on a single VPS.

The fastest way to production: one Ubuntu VPS from any provider runs everything. One install script, every feature of API Maker, and the lowest possible cost.

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/single-serverLive
  • Request
  • Response
  • Cache hit
  • Write
  • WebSocket event
Servers
1VPS
Workers
4CPU cores
Capacity
~2,759req/s
Cache hits
0%of reads

One command sets it up. The install script puts API Maker, its MongoDB and Redis on a fresh Ubuntu VPS. Your database can live on the same server.

How it works

The same steps as the diagram, in more detail.

  1. One command sets it up.

    Run the install script on a fresh Ubuntu 22.04 VPS. It installs Docker, starts MongoDB 6 as a replica set and Redis 7 in containers, installs API Maker and starts it with its admin panel. MongoDB runs as a replica set even on one server, because API Maker uses its transactions, e.g. to apply a Git pull all at once.

  2. Every core serves requests.

    Web and mobile apps send their requests to port 38246. API Maker runs as a cluster: with cpuCount set to AUTO it starts one worker per CPU core (limited by the memory, one worker per 2 GB), and the requests are shared between them. If a worker exits, the cluster starts it again on its own.

  3. Repeat reads skip the database.

    Turn on caching for a table, an API or a custom API and API Maker keeps the responses in Redis. The next same request is answered from memory, with the header x-am-data-source: cache. Every insert, update or delete on the table resets its cache, so no one reads stale data. Keys expire on their own after redisValueExpireInSeconds.

  4. Changes are pushed live.

    Frontends and devices open a WebSocket to port 38245 and subscribe to events: calls of an API, like the insert of an order, with conditions on the response, or events of your own custom code. The worker that answers the call publishes the event in Redis, and the worker holding the WebSocket pushes it to the client. No polling, no extra server.

  5. Custom code runs sandboxed.

    Business logic written in the admin panel (custom APIs, pre and post hooks, schedulers, utility classes) runs in sandbox containers managed by API Maker. Each worker has its own sandbox, so custom code never blocks the generated APIs and cannot reach the files of the server.

  6. Grow the server when you need to.

    More traffic? Resize the VPS: after a short restart, cpuCount AUTO starts a worker on every new core. This is the limit of the architecture: everything shares one machine, and while it restarts nothing answers. The next architectures move the databases out and add servers, without changing a single API.

Why choose this architecture

Lowest cost

One VPS from any provider. In our benchmark a 4 vCPU server answered ~2,759 requests per second.

Live in minutes

The install script sets up Docker, MongoDB, Redis and API Maker. Nothing to network or secure between servers.

Every feature included

Generated and custom APIs, schedulers, WebSockets, caching, Git deployment and logs: nothing is left out.

Fast by default

No network between API Maker and its databases: every query and cache read stays inside the machine.

Ready for Git

Perfect for DEV and QA: the same Git branches later deploy to the bigger architectures with a pull.

Easy to outgrow

Moving the databases out or adding servers later only changes connection strings in .env. Your APIs stay the same.

Server configuration

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

All-in-one VPS

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

Runs

  • API Maker backend, cpuCount AUTO
  • Admin panel
  • Docker: sandbox containers of custom code
  • MongoDB 6 replica set: api_maker_db, api_maker_logs
  • Redis 7: internal and cache
  • Your database: PostgreSQL, MySQL, MongoDB…

Ports

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

Minimum: 1 vCPU, 1 GB RAM with 2 GB swap, 20 GB storage, Ubuntu 22.04 LTS.

Install on a fresh Ubuntu VPSterminal
curl -fsSL https://apimaker.dev/v1/install.sh > install.sh && bash install.sh --default --version=latest

It installs every dependency, starts every process and prints the URLs at the end.

Settings of the server.env
am__serverName="server1"am__port="38246"      # HTTP APIsam__wsPort="38245"    # WebSocket notificationsam__cpuCount="AUTO"   # a worker per CPU core# API Maker's own MongoDB, and its logs: on this serveram__mongo_db_connection="mongodb://mongo_user:***@127.0.0.1:38248/api_maker_db?authSource=admin&replicaSet=rs0&directConnection=true"am__logs__mongo_db_connection_logs="mongodb://mongo_user:***@127.0.0.1:38248/api_maker_logs?authSource=admin&replicaSet=rs0&directConnection=true"# One Redis for internal use and for the cacheam__redisInternal='{"nodes": [{port: 7479, host: "127.0.0.1", pass: "***"}]}'am__redisExternal='{"nodes": [{port: 7479, host: "127.0.0.1", pass: "***"}], redisValueExpireInSeconds: 7200}'

Good to know

  • A single point of failure: when the VPS stops, every app stops. Keep snapshots of the VPS and dumps of the databases on another machine.
  • API Maker, the sandboxes and the databases share the same CPU, memory and disk.
  • It grows up only: a bigger VPS means a short restart while it is resized.
When you outgrow itYour database needs its own CPU, memory and disk. Separate database server

Questions

Is a single server enough for production?

For many apps, yes. In our benchmark (Linode, MongoDB 6, 10 rows of 10 columns) a 4-core VPS answered about 2,759 requests per second and an 8-core one about 4,529. Keep backups on another machine, since one server is also one point of failure.

What is the smallest server API Maker runs on?

1 CPU core, 1 GB of RAM with 2 GB of swap and 20 GB of storage, on Ubuntu 22.04 LTS. Give it 4 GB or more when your database runs on the same server.

Can I move to more servers later?

Yes. API Maker keeps your APIs, schemas and settings in its own MongoDB. Move the databases out, or add servers that point to the same MongoDB and Redis: only the connection strings in .env change.