Crates.io | dis-spawner |
lib.rs | dis-spawner |
version | 0.1.9 |
source | src |
created_at | 2022-02-17 19:01:19.896313 |
updated_at | 2022-03-23 12:30:29.02952 |
description | Session-lived containers for advanced browser-based applications. |
homepage | https://spawner.dev |
repository | https://github.com/drifting-in-space/spawner |
max_upload_size | |
id | 534293 |
size | 43,262 |
Component | Image | Crate | Version |
---|---|---|---|
core |
dis-spawner |
||
controller |
spawner-controller |
||
sidecar |
spawner-sidecar |
||
sweeper |
spawner-sweeper |
||
api |
spawner-api |
dis-spawner-api |
Watch a 3-minute demo of installing and using Spawner.
Spawner allows web applications to create session-lived backends, which are server processes dedicated to individual (or small groups of) users.
The server processes can be any server that speaks HTTP, including WebSocket servers. Spawner provides an API for spinning these servers up when a new user connects, and automatically terminates them when the user disconnects.
Spawner is still new and evolving. If you're interested in using it, we'd love to hear about your use case and help you get started. Feel free to open an issue on GitHub or contact Paul at paul@driftingin.space.
Spawner is intended for cases where a web app needs a dedicated, stateful back-end to talk to for the duration of a session. One area where this approach is currently common is web-based IDEs like GitHub Codespaces, which spin up a container for each user to run code in. It's also useful as a back-end for real-time collaboration, when the document state is non-trivial and needs more than just a Pub/Sub architecture (see e.g. Figma's description of how they run one process per active document.)
By making it low-stakes to experiment with this architecture, our hope is that Spawner will help developers find new use-cases, like loading a large dataset into memory to allow low-latency interactive data exploration.
Depending on your needs, it may also make sense as a back-end for games and virtual spaces, but also see Agones for that use case.
Spawner is built on top of Kubernetes, an open-source container orchestration
system. Spawner provides the SessionLivedBackend
custom resource,
representing a single instance of an application backend, and a series of components which act together
to own the lifecycle of that backend:
SessionLivedBackend
instances.SessionLivedBackend
objects and creates the backing compute and
network resources needed to provide the backend and enable an external user to connect to it.See the docs directory for more information.