Skip to content

Commit 3b5160c

Browse files
authored
Merge pull request #69 from objectstack-ai/claude/issue-64-architecture-runtime-model
docs(architecture): describe the single-environment runtime, without invented figures
2 parents 722e842 + 3bc684e commit 3b5160c

1 file changed

Lines changed: 42 additions & 25 deletions

File tree

‎content/docs/architecture.mdx‎

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ metadata after a HITL approval.
2222

2323
## What you deploy
2424

25-
One Node.js process per ObjectOS instance. That's it.
25+
One Node.js process, serving one app. That's it.
2626

2727
```text
2828
┌─────────────────────────────────────────────────────┐
2929
│ ObjectOS process │
3030
│ ┌───────────────────────────────────────────────┐ │
31-
│ │ HTTP dispatcher (/ · /api · /_console …) │ │
31+
│ │ HTTP dispatcher (/ · /api · /_console …) │ │
3232
│ ├───────────────────────────────────────────────┤ │
33-
│ │ Per-project ObjectKernel (LRU cached) │ │
33+
│ │ ObjectKernel — this deployment's app │ │
3434
│ │ ├─ Auth (Better Auth) │ │
3535
│ │ ├─ Security (RBAC + row-level + field) │ │
3636
│ │ ├─ ObjectQL (data engine, generates SQL) │ │
@@ -49,6 +49,13 @@ It's a single statically-linked binary's worth of complexity. No
4949
sidecar, no Kafka, no separate cache layer required. Add those when you
5050
need them; don't pay for them on day one.
5151

52+
**A deployment serves one app.** Which app is a deployment-level
53+
decision — see [Boot modes](#boot-modes) — and it is the same app for
54+
everyone the deployment serves, including a walled deployment where
55+
several organizations share it. You grow the deployment by running more
56+
identical replicas of the same process, not by packing more apps into
57+
one; see [Docker](/docs/deploy/docker).
58+
5259
## Where your data lives
5360

5461
| Data | Lives in | Leaves your network? |
@@ -67,18 +74,21 @@ internet access entirely, it keeps running indefinitely. See
6774
## How a request is served
6875

6976
```text
70-
1. Ingress / TLS termination (your load balancer)
71-
2. HTTP dispatcher (security headers, request id)
72-
3. Hostname → project resolution (cached, TTL configurable)
73-
4. Get or build per-project kernel from LRU
74-
5. AuthPlugin — session cookie, bearer token, or API key
75-
6. SecurityPlugin — RBAC + row-level + field-level checks
76-
7. Route handler — generated REST, declarative action, or custom
77-
8. Data driver — ObjectQL compiles to SQL / Mongo query
78-
9. Response with X-Request-Id propagated
77+
1. Ingress / TLS termination (your load balancer)
78+
2. HTTP dispatcher (security headers, request id)
79+
3. AuthPlugin — session cookie, bearer token, or API key
80+
4. SecurityPlugin — RBAC + row-level + field-level checks
81+
5. Route handler — generated REST, declarative action, or custom
82+
6. Data driver — ObjectQL compiles to SQL / Mongo query
83+
7. Response with X-Request-Id propagated
7984
```
8085

81-
Steps 4-8 typically execute in < 5ms once the kernel is warm.
86+
The app is already resolved before the first request arrives: the
87+
kernel is built during startup, and the process does not report itself
88+
[ready](/docs/deploy/docker) until it is. So a served request carries no
89+
step that decides *which* app it belongs to, and there is no per-app
90+
warmup for a reader to plan around — what a request costs is
91+
authentication, the permission checks, and one compiled query.
8292

8393
## The three layers (only matters if you're integrating)
8494

@@ -93,9 +103,8 @@ you want to know where the artifact comes from:
93103

94104
If you're shipping a single app, you don't need a control plane —
95105
compile `objectstack.config.ts → dist/objectstack.json` in your CI and
96-
ship the JSON in the image. If you're running an internal app
97-
marketplace with many tenants and apps, the control plane is where the
98-
catalog lives.
106+
ship the JSON in the image. If you publish apps that several
107+
deployments install, the control plane is where that catalog lives.
99108

100109
## Boot modes
101110

@@ -120,20 +129,28 @@ posture is [refused at startup](/docs/deploy/air-gapped).
120129

121130
## Performance characteristics
122131

123-
| Metric | Number |
132+
**This page publishes no latency or memory figures.** What you run is a
133+
digest-pinned image serving *your* app against *your* database, and the
134+
only numbers worth sizing a deployment against are the ones you measure
135+
on that. What this page can give you is the shape — where each cost
136+
comes from, and what to measure it as.
137+
138+
| Characteristic | Where it comes from, and how to measure it |
124139
|---|---|
125-
| Cold start (process up, ready for traffic) | ~1 second |
126-
| Per-kernel warmup (first request to a project) | 50-300ms depending on capabilities |
127-
| Warm request latency (CRUD via REST) | typically < 10ms + database latency |
128-
| Memory footprint | ~150MB base; ~10-30MB per active project kernel |
129-
| Concurrent app kernels per instance | Bounded by the runtime's kernel cache |
140+
| **Startup** | The process starts, builds the kernel for this deployment's app, and only then reports ready. Measure it as time to a 200 from `/api/v1/ready` on your own image and artifact; a larger app and more loaded capabilities give it more to do. |
141+
| **Request latency** | Authentication, the permission checks, and one query compiled by ObjectQL. Nothing per-request resolves which app to serve, so the database round trip is the part that usually moves; measure it at your own percentiles, against your own data volume. |
142+
| **Memory** | One resident copy of this deployment's metadata, plus the capabilities the app loads — they are optional plugins, so a deployment that loads fewer holds less — plus whatever your concurrency has in flight. Measure the container's RSS under your own load, not at idle. |
143+
| **Growing past one process** | Replicas of the same process, each serving the same app. Past one replica the cluster driver and identical shared secrets stop being optional — see [Docker](/docs/deploy/docker). |
130144

131145
## Why this shape
132146

133147
- **One Node process, no sidecars** → fits in a `docker run`, fits in a
134-
systemd unit, fits in a Lambda-like environment.
135-
- **Per-project kernel, LRU cached** → one instance can serve many
136-
small apps without paying the warmup cost on every request.
148+
systemd unit, fits in a long-lived container or VM.
149+
- **One app per deployment** → the metadata is resolved once at
150+
startup rather than per request, so there is no cache sizing to get
151+
right; where several organizations share a deployment, they share its
152+
app and the isolation wall between them is enforced inside the
153+
runtime.
137154
- **Generated APIs on top of declared metadata** → there's no codegen
138155
step in your CI, no client SDK to publish; the API matches your data
139156
model by construction.

0 commit comments

Comments
 (0)