Compared with what you know · The Plain Web Stack · diadem.fun
The Plain Web Stack11 / 15

Compared with what you know

The next app has a page that reads notes, shows them in a list, accepts a note through a form, and redirects or refreshes the list after the write. It also needs schema changes without lost data and enough diagnostics to explain a slow request. The choice is not which library wins a generic benchmark. It is what code, runtime, deployment and operational obligations this particular app acquires. This is a comparison of documented capabilities, not a shootout. What is said about TradJS, sqlite-zod-orm and measure-fn comes from the earlier chapters, where it was tested. What is said about the other tools comes from their official documentation and release notes, linked below, read in November 2026. We did not build the same app five times, count shipped bytes or rerun anyone's benchmark: where a cell says not measured, nobody here measured it. "Not documented" means the cited documentation does not promise that behaviour built in, not that it is impossible.

The page: choose a rendering framework#

Framework What you write for a form + list JavaScript on a page with no interaction CSRF for the form Escaping and unsafe URLs Deployment Components and ecosystem Better choice when
TradJS app/page.tsx reads and renders; <form action> posts to app/api/.../route.ts; page.client.tsx only if needed. None for a page needing no interaction; bytes not measured. Rejects cross-origin cookie-bearing POST/PUT/PATCH/DELETE by default. Text is escaped; dangerous link schemes, srcdoc and style URLs are removed on the server and in the browser (chapter 7). Bun server, persistent local SQLite; prerendered routes via ssg. No edge or serverless target. Its own JSX renderer; React components do not run unchanged. Ecosystem size not measured. HTML navigation, ordinary forms, one durable host and small local scripts are sufficient.
Next.js App Router Server Component page.tsx fetches the list; <form action={serverAction}> mutates it. Route Handler is another POST path. (F01) Server Components add no component JS; Link uses client navigation. Total framework JS not measured. (F02, F03) Origin/Host protection applies to Server Actions; do not assume it protects arbitrary Route Handlers. (F04) React warns against raw HTML; Next warns that untrusted router.push URLs, including javascript:, execute code. (F06, F05) Node server, Docker, constrained static export or platform adapters; platform-specific edge support varies. (F07) React components and published shadcn/ui Next setup; library count not measured. (F25) React component reuse, Server Components and platform integration matter more than having zero router runtime. (F02, F07)
Remix / React Router (Framework Mode, 7.12 or later; 8 is current) Route loader returns list; route action processes <Form method="post">; loader data revalidates. (F08, F09) With SSR, omit <Scripts /> for a traditional HTML-only app; include it for hydrated routing. Bytes not measured. (F10) v7.12+ checks origins for UI action submissions by default; reverse-proxy host configuration matters. Not a blanket claim for arbitrary endpoints. (F11) React raw-HTML escape hatch needs care; v7.12 fixed redirect validation and a server-rendered XSS case. (F06, F11) SSR on Node/Cloudflare-style targets; static deployment for an appropriate build. (F12) React libraries and documented shadcn/ui setup; ecosystem count not measured. (F25) You want React, native-form progressive enhancement and automatic loader revalidation. (F09)
Astro .astro page renders the list; an on-demand action or endpoint handles a normal HTML form. (F13) HTML/CSS by default; client JS only for opted-in scripts/islands. Bytes not measured. (F14) security.checkOrigin: true by default for specified unsafe form requests to on-demand-rendered pages. (F15) Template text is escaped; set:html is not. A universal unsafe-URL denylist is not verified here. (F16) Static build by default; SSR needs an adapter/server runtime. (F17) Official React/Vue/Svelte/etc. integrations, with islands; ecosystem count not measured. (F18) Content pages dominate and a few interactive islands or on-demand forms suffice. (F14, F13)
Hono + htmx Hono app.get renders JSX/HTML; app.post returns a new HTML fragment; hx-post swaps it in. (F19, F24) Plain Hono HTML sends no app JS; htmx enhancement requires its browser script. Bytes not measured. (F23) Install csrf() middleware explicitly; not an automatic default for an unconfigured Hono app. (F20) Hono html escapes ordinary interpolations, not raw; htmx requires escaping untrusted fragment content. Unsafe-URL policy not verified. (F21, F23) Hono supports Bun, Node, Workers and serverless environments; persistence depends on host. (F22) HTML/template-first; no automatic React-library compatibility. Extension count not measured. (F19, F23) You want explicit HTTP handlers, partial HTML updates and runtime portability. (F22, F24)
Framework sources (official documentation and release notes):
  • F01: Next.js App Router: a form can call a Server Action to mutate data.
  • F02: Next.js: Server Components do not send component JavaScript; Client Components hydrate.
  • F03: Next.js App Router client-side navigation and prefetching.
  • F04: Next.js Server Actions compare Origin with Host to defend against CSRF.
  • F05: Next.js warns untrusted router navigation URLs, including javascript: URLs, can execute code.
  • F06: React rendering contract and danger of dangerouslySetInnerHTML with untrusted HTML.
  • F07: Next.js deployments: Node.js, Docker, static export with limitations, adapters.
  • F08: React Router framework route modules expose loaders, actions and components.
  • F09: React Router Form uses browser form semantics, actions, progressive enhancement and automatic revalidation.
  • F10: React Router 7: omitting Scripts while using SSR yields HTML-only navigation.
  • F11: React Router v7.12.0 (2026-01-07) introduced UI action cross-origin CSRF checks and redirect validation; later release notes discuss checks.
  • F12: React Router framework deployments include Node and Cloudflare templates and static hosting.
  • F13: Astro form submissions can invoke actions without browser JavaScript when rendered on demand.
  • F14: Astro default static HTML and CSS with JavaScript only on explicitly hydrated islands.
  • F15: Astro default origin check on on-demand form requests; scope and CSP settings.
  • F16: Astro escapes template expressions; set:html is unescaped and risks XSS.
  • F17: Astro static output and SSR adapters.
  • F18: Astro official integrations with React, Vue, Svelte and other frameworks.
  • F19: Hono JSX SSR in route handlers; explicit JSX import source.
  • F20: Hono optional CSRF middleware and protected form content types.
  • F21: Hono html helper escapes interpolations but raw content requires manual care.
  • F22: Hono supported runtimes including Bun, Node, Cloudflare Workers and serverless platforms.
  • F23: htmx HTML attributes for AJAX fragments, progressive enhancement and need to escape untrusted injected HTML.
  • F24: htmx hx-post causes asynchronous form POST and HTML swap.
  • F25: Documented component library installation for React/Next.js, React Router and Astro; not an ecosystem count. A “no interaction” page must not be confused with a no-JavaScript configuration. Astro and TradJS document HTML-first defaults; React Router 7 can render without <Scripts />; Next.js documents that Server Component code is not bundled for the client, not a zero-byte App Router shell. Hono can return static HTML without any browser script, but using hx-post entails htmx JavaScript. (F02, F10, F14, F23) None of these statements is a measured transfer-size or interactive-performance comparison. The CSRF column describes particular request paths, not a security certification. A Server Action, a React Router UI action, an Astro on-demand form and a Hono handler do not necessarily share the same protection scope. Likewise, JSX text escaping does not prove that every href, navigation API, raw-HTML escape hatch or third-party extension is safe. The Next.js warning about router.push is a concrete counterexample to treating all frameworks' URL rules as interchangeable. (F04, F11, F15, F20, F05)

The database: choose a schema and persistence model#

Data layer Schema source Migrations Query types, relations and validation Live changes across processes Single file vs server database Better choice when
sqlite-zod-orm Zod object is table definition and input validator. At startup: additive changes, declared renames; refuses destructive/resurrecting changes. Typed queries, batched relations, soft deletes; hooks after outer commit. Triggers/journal propagate writes to processes on the same file. Bun + local SQLite file; multiple processes on one host, not many app machines. (D14) One host, Zod already in use, and same-file change notifications remove extra infrastructure.
Prisma ORM v7 schema.prisma models + generated Prisma Client. (D01) prisma migrate dev then reviewed/deployed migrations. (D02) Generated typed CRUD and relations; form-input validation remains an application responsibility. (D01) Equivalent SQLite cross-process journal not documented in cited core workflow; not measured. (D01) Local SQLite via adapter, or PostgreSQL/MySQL/etc. over a connection; Bun SQLite adapter differs. (D01, D03) A generated model client, explicit migration history or a server DB is valuable. (D01, D03)
Drizzle TypeScript SQL table definitions. (D06) drizzle-kit generate + migrate, or push; choose a migration workflow. (D07) Inferred SQL-first typed queries and relations; Zod validation is separate unless added. (D06, D10) Equivalent core same-file journal not documented; not measured. (D07) Bun SQLite driver or remote SQL drivers (Postgres/MySQL/etc.). (D08, D09) You want TypeScript schema plus control over SQL and migration files. (D06, D07)
Kysely A TypeScript Database interface, often introspected/generated from an existing schema. (D11) Code-authored migrations and migrator; not model-diff autogeneration. (D12) Typed SQL query builder; runtime conversion/validation belongs to driver or app. (D11) Equivalent core same-file journal not documented; not measured. (D11) Driver/dialect for SQLite or server SQL databases. (D11) SQL expressiveness, existing schema ownership and minimal model abstraction are priorities. (D11)
bun:sqlite directly SQL CREATE TABLE and application-owned types. (D13) Write/apply your own SQL; no ORM migration planner. (D13) Prepared SQL; type/schema synchronization and validation are your responsibility. (D13) SQLite offers concurrent file access, not an app change callback like sqlite-zod-orm's journal; write your own triggers/polling. (D13, D14) In-process SQLite file on Bun; no server DB connector in this module. (D13) You want full SQL control and can own schema evolution and event delivery. (D13)
Data-layer sources (official documentation):
  • D01: Prisma ORM v7: schema.prisma, generated typed client, migrations, SQLite adapters and Bun-specific libsql guidance.
  • D02: Prisma ORM v7 separate migration development and deployment commands.
  • D03: Prisma ORM v7 database connectors including SQLite and server SQL databases.
  • D04: Prisma ORM 8 release candidate status versus Prisma ORM 7.
  • D05: Prisma ORM 8 release candidate database support, experimental SQLite.
  • D06: Drizzle TypeScript table schemas and SQL-centric schema declaration.
  • D07: Drizzle Kit migration generation, review, push and migrate choices.
  • D08: Drizzle driver binding for Bun's SQLite file driver.
  • D09: Drizzle connectivity across SQL databases and drivers.
  • D10: Drizzle relational query definitions and querying relations.
  • D11: Kysely TypeScript Database interface, query builder, runtime types determined by drivers and dialects.
  • D12: Kysely authoring and executing migrations contrasted with generated model migrations.
  • D13: bun:sqlite synchronous prepared statements, transactions, direct SQL and SQLite file handling.
  • D14: SQLite WAL same-host shared memory, concurrent readers and single-writer characteristics. The comparison is Prisma ORM v7, not an unqualified description of “Prisma.” At this writing the official Prisma site identifies v8 as a release candidate with a changed contract/client/migration workflow; its SQLite package is experimental. Treat v7 as the generally available, well-documented reference in the table, and assess v8 separately before starting a new project. (D04, D05) A v7 SQLite-on-Bun project uses Prisma's documented adapter path, not bun:sqlite transparently. (D01) A SQLite file is durable only if the host's storage is durable. WAL coordinates processes using the same host and does not work over a network file system. (D14) Choosing Next.js, React Router, Astro or Hono for distributed/edge deployment does not make the local file accessible from many ephemeral machines. If multiple app hosts require one shared writeable database, put a server database (or a specifically designed remote database service) behind the app; both Prisma v7 and Drizzle document server-database connectors, and Kysely documents the relevant SQL dialects. (D03, D09, D11) The 58–91% in chapter 8 refers to selected sqlite-zod-orm 4.2.2 operations against hand-written bun:sqlite SQL in the recorded same-machine benchmark. It does not describe all operations: the same run has insert at 35%, upsert at 10% and insertMany at 61% of plain SQL. There is no measured Prisma/Drizzle/Kysely result in that run. These are not measured against one another; neither can a SQLite-only microbenchmark rank server databases. Use the existing benchmark as an overhead estimate for its stated operations, not as a cross-product league table.

The request: choose logs or traces#

Logging / tracing What you add to the handler What is recorded by default Nesting and timing Output, retention and secrets Runtime / deployment Better choice when
measure-fn createMeasure("api"); wrap request, DB call and render with root(...) / api(...). Per-step start/end lines, status, duration and short result; errors rethrown. Nested paths through Bun/Node AsyncLocalStorage. Console lines; Secrets in logged URLs are redacted. No OTLP export and no central retention. Bun and Node; per-call cost not measured. A single-process or same-host request needs an immediately readable duration breakdown.
pino pino() logger; call info/error, add child bindings and explicit timers if needed. (L01) Structured newline-delimited JSON log events, not automatic per-function span timings. (L01, L04) Child fields group logs; span hierarchy and elapsed times require more instrumentation. (L01) Configurable redaction and worker-thread transports to files/log services; storage/retention selected by operator. (L02, L03) Node-focused logger; Bun/runtime overhead not measured here. (L01) Searchable structured operational logs and configurable shipping matter more than step wrappers. (L02)
OpenTelemetry JS Initialize SDK/exporter; manual startActiveSpan or auto-instrumentation libraries. (L05, L06) Spans/attributes/context when instrumented; logs and metrics via separately configured SDK pipeline. (L05) Parent-child spans, durations and cross-service context. (L05, L08) Exporters/collector/backends configured separately; sensitive attributes need deliberate filtering. (L07, L09) Documented Node and browser paths; Bun SDK compatibility and relative cost not measured here. (L10) You need distributed traces, correlation across services and vendor-neutral telemetry. (L05, L07)
Logging and tracing sources (official documentation and project-maintained docs):
  • L01: Pino JSON logger API, child loggers, configuration and structured fields.
  • L02: Pino transports, destinations and worker-thread handling.
  • L03: Pino configurable redaction for selected log fields.
  • L04: Pino NDJSON default output and optional pretty transport.
  • L05: OpenTelemetry JavaScript manual tracing with startActiveSpan and SDK configuration.
  • L06: OpenTelemetry JavaScript instrumentation libraries and auto-instrumentation.
  • L07: OpenTelemetry JavaScript exporters and span/log processing.
  • L08: OpenTelemetry JavaScript async span/context propagation.
  • L09: OpenTelemetry guidance and collector processors for sensitive data redaction.
  • L10: OpenTelemetry Node.js SDK setup and exporter configuration. These tools are not always substitutes. A duration wrapper answers “which function inside this request was slow?” A structured logger answers “what events and fields did this service emit?” Distributed tracing answers “where did a request go across services?” Pino may send log events through an OpenTelemetry transport, while OpenTelemetry can coexist with application logs. (L02, L07) No common workload was measured for their CPU cost, latency overhead or log volume. In particular, do not turn measure-fn's unmeasured cost into a “lighter than OpenTelemetry” claim.

Make the choice#

Choose TradJS + sqlite-zod-orm when...#

  • Your next app is primarily server-rendered pages, ordinary links, forms and account-protected CRUD, with only a few islands of custom browser behavior. You accept TradJS's non-React JSX renderer and therefore do not need to import a React component library unchanged.
  • Your data and WAL file can remain on one durable machine. Several processes may serve that host, but you are not planning a shared local SQLite file across serverless functions, edge regions or multiple application hosts. (D14)
  • Your validation rules naturally fit Zod objects; creating and migrating SQLite tables from those definitions reduces the number of competing schema descriptions you maintain.
  • You need transactional after-commit hooks or same-file cross-process change feed, and you are willing to operate and inspect the journal semantics yourself rather than assume a remote pub/sub bus exists.
  • You need local nested timings while deciding whether to add broader logging and telemetry. You accept that measure-fn overhead and cross-tool log benchmarks are not measured.

Choose X instead when...#

  • Choose Next.js App Router when a React component system, Server Components, client navigation and hosting/platform integrations are significant requirements. Use Server Actions when you intend to rely on their documented CSRF check, and separately secure Route Handlers. (F01, F04, F07)
  • Choose React Router 7 Framework Mode (the Remix successor) when React plus route loaders/actions, form revalidation and a deliberate no-JS SSR mode fit your team. Use v7.12 or newer for the documented origin-check fix, and verify proxy headers during deployment. (F08, F09, F10, F11)
  • Choose Astro when the site is primarily content or statically generated pages with a limited number of on-demand forms and interactive islands; it also lets you reuse selected React/Vue/Svelte components. (F13, F14, F18)
  • Choose Hono + htmx when you prefer writing HTTP handlers and swapping server-returned HTML fragments, including on an edge-capable runtime. Add CSRF middleware and escape fragment content as part of the implementation, not as optional follow-up work. (F20, F22, F23)
  • Choose Prisma v7 when you want its generated client, migration history and a supported path to a database service. Evaluate the changing v8 release candidate separately rather than assuming identical APIs. (D01, D02, D04)
  • Choose Drizzle when TypeScript table definitions, SQL-like queries, reviewable migrations and Bun SQLite or PostgreSQL/MySQL connections are a better fit than Zod-defined tables. (D06, D07, D08, D09)
  • Choose Kysely when an existing database is the source of truth and you want typed SQL with minimal ORM behavior; maintain or generate its Database interface as migrations evolve. (D11, D12)
  • Choose bun:sqlite directly when your schema is small, queries are performance-sensitive and you are prepared to write SQL, migrations, runtime validation and change notification yourself. Chapter 8's direct-SQL baseline applies here, not as a guarantee of any production application's speed. (D13)
  • Choose pino when machine-readable event logs, child bindings, redaction paths and configurable transports are immediate requirements. (L01, L02, L03)
  • Choose OpenTelemetry JS when the user journey crosses services and you need trace context, sampling/exporters and backend correlation. Budget for instrumentation and sensitive-data policy; neither the integration work nor performance overhead has been measured in this chapter. (L05, L07, L09) The decision is therefore architectural rather than fashionable: a durable single-host HTML app can use these three libraries without needing a client router, a server database or a tracing backend. Once the requirements explicitly demand React's components, multi-host persistence, edge-native storage or cross-service telemetry, use the corresponding alternative instead of forcing the local stack across a boundary it does not promise to cross.