It's not serverless, since Typesense needs to be a long-running process.
Typesense keeps its search indexes in memory. On startup, it loads all collections from disk into memory before serving requests. This warm-up is fine for a persistent server, but edge functions are ephemeral and can’t maintain state between invocations. You’d need to rebuild indexes on every cold start, which defeats the purpose.
The system uses RocksDB for persistent storage of documents and metadata. It writes to disk for durability and loads collections from disk on startup. Edge functions are stateless and don’t have persistent local storage, so there’s nowhere to keep this data.
For clustering, Typesense uses Raft consensus. It maintains persistent Raft logs, snapshots, and metadata that must survive restarts. Nodes coordinate through peering services and maintain cluster state. Edge functions can’t maintain this persistent state or participate in consensus protocols.
Typesense runs as a long-running process with background threads for batch indexing, analytics, housekeeping, and garbage collection. These threads need to run continuously. Edge functions are request-scoped and can’t run background processes.
The architecture assumes dedicated resources. It maintains indexes in memory, handles concurrent operations with thread pools, and needs consistent CPU and memory. Edge functions have strict resource limits and can’t provide the sustained resources Typesense needs.
In short, Typesense is built for persistent, stateful servers with dedicated resources, not ephemeral, stateless edge functions. It needs to maintain state, coordinate with other nodes, and keep indexes warm in memory, which conflicts with how edge computing works.