This document describes the supported Prisma Compute deployment that layers two browser entrypoints on top of the normal Streams server:
/studioserves the Prisma Studio streams-only UI against the colocated Streams server./generateserves a write generator with1k,10k, and100kbuttons. The page includes a stream-name field that defaults todemo-app. Each run ensures that selectedapplication/jsonstream has theevlogprofile and appends canonical evlog records in server-side chunks with live progress polling.
The normal Streams HTTP surface remains available on /v1/*.
By default, this entrypoint can still run a colocated Streams app. For the
Studio/generator demo, prefer external-streams mode by setting
COMPUTE_DEMO_STREAMS_SERVER_URL. In that mode, the deployment does not create
or use a local Streams store; it proxies Studio and generator writes to the
configured Streams server.
Use src/compute/demo_entry.ts for this
deployment shape. It:
- applies the normal Compute argv defaults from
src/compute/entry.ts, including--object-store r2and--auto-tunewhenDS_MEMORY_LIMIT_MBis set, before the colocated Streams server config is loaded - requires the same explicit auth mode as the normal full server:
--auth-strategy api-keywithAPI_KEY, or--no-auth - starts the regular Streams app in-process
- fronts it with the
/studio,/studio/api/streams/*,/generate, and/api/generate/jobs*routes - defaults the generator stream field to
demo-app
When COMPUTE_DEMO_STREAMS_SERVER_URL or STREAMS_SERVER_URL is set, the
entrypoint skips the colocated Streams app and proxies all Streams requests to
that external server instead.
For the colocated 1 GiB Compute demo, the 1024 MiB auto-tune preset keeps
segmenting in the main process, seals smaller 8 MiB / 50k-row segments,
disables the segment disk cache, uses one upload lane, and limits
bundled-companion work to one segment / one yield block per pass. During a
generate job, the colocated demo pauses segmenter and indexer loops, appends
directly to the in-process ingest queue instead of serializing batches through
Bun's Request body path, then resumes background cutting and indexing for the
generated stream. That avoids overlapping the generator, append path, segment
cutting, uploading, and companion building too aggressively on Compute hosts
whose effective RSS headroom is lower than the nominal memory preset.
When the generator runs on a separate server and writes over HTTP, the Streams server cannot use the colocated direct-append pause hooks. The low-memory server preset still keeps append responses non-keep-alive and defers immediate index/companion enqueue wakeups until the server has had a short foreground-quiet window, with a bounded deferral cap so a continuous trickle of writes cannot starve background catch-up. Uploaded segments therefore avoid starting companion backfill while the external generator is still bursting writes, but continue to make progress after the burst or during low-rate ingest.
Studio assets are not part of this repository, so the Compute bundle must be prebuilt with a local Studio checkout available.
Default Studio root discovery:
PRISMA_STUDIO_ROOT, if set- otherwise the sibling repository path
../studio
Build the bundle:
bun run build:compute-demo-bundleThat script:
- prebuilds the Studio demo client and CSS
- injects them into the bundle through a virtual module
- bundles
src/compute/demo_entry.ts - bundles the Streams worker entrypoints required on Compute
Example Compute deploy:
PRISMA_API_TOKEN=... \
bunx @prisma/compute-cli deploy \
--service your-service-id \
--skip-build \
--path .compute-demo-build/bundle \
--entrypoint compute/demo_entry.jsRequired runtime env is the same as the normal R2-backed Compute server:
DS_HOST=0.0.0.0DS_ROOT=/mnt/app/prisma-streamsDS_MEMORY_LIMIT_MB=1024API_KEYwhen using--auth-strategy api-keyDURABLE_STREAMS_R2_BUCKETDURABLE_STREAMS_R2_ACCOUNT_IDDURABLE_STREAMS_R2_ACCESS_KEY_IDDURABLE_STREAMS_R2_SECRET_ACCESS_KEY
On Prisma Compute, keep DS_ROOT under /mnt/app. Paths such as /tmp are
ephemeral and lose the colocated Streams SQLite state on restart.
External-streams demo mode only needs the HTTP bind settings plus the target Streams server and an explicit auth mode:
DS_HOST=0.0.0.0 \
API_KEY=replace-with-at-least-10-characters \
COMPUTE_DEMO_STREAMS_SERVER_URL=https://cmoa45nql0u6bzycn7dwdpxe0.cdg.prisma.build \
bun run src/compute/demo_entry.ts --auth-strategy api-keyThe Studio browser app still reads config from /api/config, but that config
points its Streams integration at /studio/api/streams.
That proxy path forwards to the configured Streams target, so Studio is always
inspecting the same server that /generate writes to.