Skip to content

Releases: clockworklabs/SpacetimeDB

Release v2.6.0

16 Jun 22:07
31fd1c8

Choose a tag to compare

2.6.0 adds Primary Key support for Views in Rust, TypeScript, and C#, improves event table automigrations, includes CLI binary distribution improvements, and brings various performance enhancements and bug fixes.

Features

Primary Key support for Views (Rust, TypeScript, and C#)

Procedural views now support primary keys in Rust, TypeScript, and C#

Note: C++ support for primary keys in views will be added in a future release.

  • Rust: Declare primary keys in the #[view] macro:

    #[spacetimedb::view(accessor = my_players, public, primary_key = id)]
    pub fn my_players(ctx: &spacetimedb::ViewContext) -> Vec<Player> {
        ctx.db.players().owner().filter(ctx.sender()).collect()
    }

    (#5111)

  • TypeScript: Declare primary keys at the column/row level:

    const Player = t.row('Player', {
      id: t.u64().primaryKey(),
      owner: t.identity().index('btree'),
      name: t.string(),
    });
    
    export const my_players = spacetimedb.view(
      { public: true },
      t.array(players.rowType),
      ctx => Array.from(ctx.db.players.owner.filter(ctx.sender))
    );

    (#5111)

  • C#: Following Rust and TypeScript support in previous releases, C# modules can now declare primary keys on procedural views:

    [SpacetimeDB.View(primaryKey: nameof(Player.Id))]
    public static List<Player> MyPlayers(ViewContext ctx) => ...

    (#5246)

Performance & Correctness

  • Commitlog configuration knobs: Added max_segment_size, write_buffer_size, and preallocate_segments configuration options to config.toml for the commitlog. The default write_buffer_size has been increased from 8KiB to 128KiB to optimize high-throughput workloads.
    (#5074)

Bug Fixes

  • Timestamp primary keys in C#: Timestamps can now be used as primary keys in C# modules, making C# consistent with the other module languages.
    (#5262)

What's Changed

Full Changelog: v2.5.0...v2.6.0

Release v2.5.0

11 Jun 23:30
ca16958

Choose a tag to compare

2.5.0 graduates procedures to stable availability, improves billing metric accuracy, and includes CLI usability fixes.


Features

Procedures are now stable (Ungated from unstable)

Procedures-scheduled, transaction-capable server-side functions-and the outgoing HTTP client (ctx.http) are now available without opting into unstable features (#5164).

  • Rust: The #[spacetimedb::procedure] macro, ProcedureContext, with_tx/try_with_tx, and scheduled procedures now work without features = ["unstable"].
  • C#: [Experimental("STDB_UNSTABLE")] removed from ProcedureContext.WithTx/TryWithTx.
  • C++: Procedure ABI, transaction execution, and outgoing HTTP client are now available without SPACETIMEDB_UNSTABLE_FEATURES.

HTTP handlers/webhooks, views, and RLS (client_visibility_filter) remain gated behind unstable.

Primary key support for procedural views (C#)

Following Rust and TypeScript support in v2.4.1, C# modules can now declare primary keys on procedural views, enabling clients to receive OnUpdate events when subscribed to them (#5246).

Layout-altering automigrations for event tables

Event tables now support a broader set of schema- and layout-altering automigrations, including column removal, reordering, and type changes that would be rejected for regular tables (#5269). This enables more flexible schema evolution for event-only tables without requiring manual migration.


Performance & Correctness

  • Deterministic row insertion with BTreeSet storage (#5071): Non-full pages are now stored in a BTreeSet sorted by available var-len granules rather than an unsorted Vec. This fixes accidentally-quadratic behavior during bulk inserts and ensures deterministic row insertion locations across datastore restarts

Bug Fixes

  • wasm_memory_bytes metric accuracy (#5131): The metric now correctly reports memory for all Wasmtime instances (cooperatively updated via increment/decrement) and no longer includes V8 instances. Billing impact: billing code should now charge for the sum of wasm_memory_bytes + v8_used_heap_size_bytes. Expect recorded usage per database to increase as we now account for all instances, not just one.
  • Template version constraints (#5228): All templates now consistently use major.minor version constraints. Previously, inconsistent version constraints could cause the CLI to initialize templates expecting versions that did not exist.
  • CLI publish --delete-data config fallback (#5256): Removes the forced positional database name requirement, allowing spacetime.json to provide the database name.
  • CLI call with hex Identity arguments (#5254): The call command now accepts hex strings for Identity parameters without requiring full JSON tuple syntax.

What's Changed

New Contributors

Full Changelog: v2.4.1...v2.5.0

Release v2.4.1

05 Jun 17:02

Choose a tag to compare

We are releasing two small patches on top of 2.4.0:

(#5111) Add primary key support for procedural views to rust and ts modules

Adds support for primary keys to procedural views in rust and typescript modules. Now clients can receive update events when subscribed to such views.

(#5145) Fix index schema from st tables.
This fixes #4701.

More to come soon!

Full Changelog: v2.4.0...v2.4.1

Release v2.4.0

03 Jun 18:11
b354744

Choose a tag to compare

2.4.0 brings a headline new capability for Rust modules HTTP handlers alongside meaningful improvements to runtime performance, durability correctness, and server-side observability. The changelog is focused but every entry is production-relevant.

Features

HTTP handlers in modules

This is currently an unstable feature and will need to be enabled to have be available.

  • Rust users can enable unstable features in their Cargo.toml:
[dependencies]
spacetimedb = { version = "1.*", features = ["unstable"] }
  • C# users can enable unstable features by adding #pragma warning disable STDB_UNSTABLE at the top of your file.
  • C++ users can enable unstable features by adding #define SPACETIMEDB_UNSTABLE_FEATURES before including the SpacetimeDB header.

Modules can now define custom HTTP routes and serve arbitrary HTTP requests directly from module code (Rust: #4636, Typescript: #4980, C#: #5024,C++: #5023).

Using a Rust as an example, annotate a function with #[spacetimedb::http::handler] to create a handler, then wire it into your module's routing table with #[spacetimedb::http::router].

#[spacetimedb::http::handler]
fn insert(ctx: &mut HandlerContext, request: Request) -> Response {
    let body: Vec<u8> = request.into_body().into_bytes().into();
    let id = ctx.with_tx(|tx| tx.db.data().insert(Data { id: 0, body }).id);
    Response::new(Body::from_bytes(format!("{id}")))
}

#[spacetimedb::http::router]
fn router() -> Router {
    Router::new().post("/insert", insert).get("/retrieve", retrieve)
}

#5024 adds the C# handler/router API [SpacetimeDB.HttpHandler], [SpacetimeDB.HttpRouter]
#5023 adds the C++ handler/router API SPACETIMEDB_HTTP_HANDLER(), SPACETIMEDB_HTTP_ROUTER()

All user-defined routes are exposed under /v1/database/:name_or_identity/route/{*path}. Handlers have access to a HandlerContext that can open a database transaction, giving you full read/write access to your tables.

This opens the door to webhook integrations, REST-style APIs for non-realtime clients, and any other HTTP-driven interaction you want to build on top of your SpacetimeDB module.

Faster WASM reducer execution

Reducers now run on a dedicated synchronous WASM runtime backed by a single OS thread, instead of sharing the async runtime that procedures use (#5095). Because reducers never yield, the old async scaffolding was pure overhead. The synchronous path removes that cost from the hot path for every reducer invocation.

Bug Fixes

  • Durability: silent data loss on resume fixed. The commitlog could silently corrupt a segment on restart if trailing bytes shorter than a commit header were left behind. A subsequent append would render the segment corrupt, and anything written after those trailing bytes would become unreachable after the next restart. The segment is now truncated to its validated size before writes resume (#5116).
  • V8 heap metrics now cover procedure workers. Previously V8HeapMetrics were tracked only for reducer workers, leaving memory usage by JavaScript procedure workers invisible. Procedure worker heap usage is now aggregated and reported alongside the reducer worker metrics (#5122).
  • Commitlog decode errors include context. Errors encountered while decoding commits now carry additional context, making it substantially easier to diagnose corrupted or truncated log segments in production (#5129).
  • Reverted energy/execution-time conversion in V8 host. A regression introduced in v2.3.0 in how execution time was converted to energy units for JavaScript modules was reverted (#4927).

What's Changed

Full Changelog: v2.3.0...v2.4.0

Release v2.3.0

27 May 19:32

Choose a tag to compare

This release brings first-party Godot support and major WebSocket performance improvements. We've also landed significant pipeline optimizations, commitlog enhancements, and expanded our framework coverage.

Features

First-party Godot SDK and Blackholio Tutorial

SpacetimeDB now officially supports Godot with a complete C# SDK integration. The new Blackholio tutorial walks through building a multiplayer asteroids-style game, demonstrating best practices for entity replication, player input handling, and game state management in Godot (#4920).

Faster WebSocket Transport with Batched Responses

The WebSocket layer now pipelines and batches responses using the v3 protocol, significantly reducing per-message overhead under high load. Combined with pipelined JavaScript module operations (#4962), WASM module operations (#4973), and a fully pipelined WebSocket send path (#5051), this delivers substantially improved throughput for real-time applications.

HTTP/2 Backend Support

The SpacetimeDB server now supports HTTP/2, enabling more efficient client connections with multiplexed streams and header compression (#5027).

Vue useProcedure Hook

Following the React pattern, Vue developers now have a first-class useProcedure composable for calling SpacetimeDB procedures with full TypeScript support (#4999).

Unity 6 WebGL Compatibility

C# modules and clients now support Unity 6's WebGL runtime, automatically selecting between getWasmTableEntry and dynCall as appropriate for the Unity version (#4961).

Commitlog Performance and Operations

The durability layer gained several improvements:

  • Configurable commitlog compression knobs for operational tuning (#5074)
  • Compression deferred when under write load to prioritize throughput (#4974)
  • Non-blocking compression that doesn't hold locks (#4981)
  • Proper handling of empty tail segments on resumption (#4863)

Rust DbContext Generics

Rust modules can now be generic over DbContext, enabling code reuse between client and server contexts while maintaining type safety (#4707).

API Changes

  • Deprecated: ReducerContext::identity is deprecated in favor of database_identity to clarify that this represents the module's identity, not the caller's (#4843)

Bug Fixes

  • Fixed a segfault in the V8 JavaScript runtime that could crash the server (#4986)
  • Fixed connection lifecycle callbacks not firing correctly in all disconnection scenarios (#4935)
  • Fixed panics during unsubscribe operations (#4938)
  • Fixed view auto-migration when using canonical names (#4985)
  • Eliminated unnecessary msync calls on the entire offset index file, improving write performance (#5018)
  • Fixed directory fsync issues on Windows snapshots (#4939)
  • Fixed auth error details leaking in debug output (#5000)
  • Prepared statements are now properly rolled back on transaction failure (#4979)

Infrastructure

  • Client binaries are now distributed from AWS instead of DigitalOcean for improved reliability (#5077)
  • Internal: cargo ci dlls renamed to cargo regen csharp dlls (#4972)

What's Changed

New Contributors

Full Changelog: https://github.com/cloc...

Read more

Release v2.2.0

02 May 22:48
eb11e2f

Choose a tag to compare

2.2.0 is here, and this one is a meaningful step forward for SpacetimeDB's realtime performance, operational safety, and day-to-day developer workflow. There are plenty of smaller fixes in this release too, but these are the major changes worth calling out.

Features

Faster realtime transport and client throughput

Weโ€™ve introduced a new v3 WebSocket transport that batches multiple logical client messages into a single frame, cutting per-message overhead while keeping the existing message model intact (#4761). The TypeScript SDK now uses the new transport by default (#4784). Under the hood, this release also includes a substantial round of hot-path performance work across the TS client, JS module runtime, and durability pipeline to improve throughput and reduce scheduler overhead under load.

Safer production database operations

We added spacetime lock and spacetime unlock to protect databases from accidental deletion (#4502). On top of that, spacetime delete now asks for confirmation by default (#4770), spacetime list shows database names alongside identities (#4769), and spacetime publish --yes can now skip only the prompts you intend to skip instead of skipping all of them (#4885).

Better TypeScript app ergonomics

Web developers get two nice upgrades in 2.2.0. Thereโ€™s now a first-party Astro + TypeScript template with SSR and a live React island for realtime updates (#4688), and the TypeScript React bindings now include a typed useProcedure hook so procedures fit the same ergonomic pattern as reducers (#4752).

Smoother schema evolution

Publishing schema changes is less brittle now. Empty tables can be dropped during auto-migration (#4593), and changing or removing a primary key no longer leaves stale schema state behind that breaks future publishes (#4666).

More powerful table and index APIs

Modules can now clear tables directly from Rust, C#, C++, and TypeScript (#4729), and the index layer gained bytes-key B-tree support for more capable multi-column range scans (#4733).

Bug Fixes

  • Improved crash resistance for JavaScript modules by preventing V8 near-heap-limit failures from taking down the server, and by rotating isolates when heap growth or fragmentation gets out of hand (#4777, #4684).
  • Fixed a schema migration bug where changing or removing a primary key could leave stale schema state behind and break a later publish (#4666).
  • Fixed table migration sequence persistence so autoinc values no longer reset after restart when a table has been migrated (#4902).
  • Windows CLI binaries are now code-signed, which should make installation and update flows smoother on Windows (#4906).
  • Improved module panic backtraces so runtime failures are easier to diagnose (#577).
  • Hardened local durability so snapshot files, metadata.toml, and pid files are properly synced to disk instead of being vulnerable to loss on an untimely crash (#4891, #4892, #4890).
  • Fixed an Unreal SDK bug where overlapping subscriptions could fire duplicate OnInsert events for already-cached rows (#4903).

If you run into anything new with this release, file an issue on GitHub or drop into Discord and let us know.

What's Changed

Read more

Release v2.1.0

24 Mar 00:56

Choose a tag to compare

Another week, another reason to celebrate ๐ŸŽ‰ 2.1.0 is here, and it's bringing some long-awaited features alongside a handful of satisfying bug squashes!

Features

๐Ÿฆ€ Rust client Wasm support

This one's been a long time coming. The Rust client SDK can now compile and run in the browser thanks to resolved Wasm compilation issues. If you've been waiting to build browser-based apps with the Rust SDK, your wait is over #4183

๐ŸŽฎ C++ Modules + Unreal SDK

Unreal developers, rejoice โ€” both the C++ module bindings and the Unreal SDK have been brought up to speed with SpacetimeDB 2.0's APIs and codegen. Full compatibility, no more workarounds.

  • Update C++ bindings for 2.0 compatibility #4461
  • Update Unreal SDK to match latest APIs and codegen #4497

Bug Fixes

There are several bug fixes in this release:

  • Fix useTable isReady reverting to false after first row event by #4580
  • Fix v2 client disconnects dropping subscriptions for other v2 clients #4648

If you experience any new issues with this release either file an issue on GitHub or drop into our Discord โ€” we're always around.

We'll see you again soon for the next release ๐Ÿ˜‰

What's Changed

New Contributors

Full Changelog: v2.0.5...v2.1.0

Release v2.0.5

13 Mar 15:54

Choose a tag to compare

Hello again everyone! This is another small bug fix release. There was a small bug introduced during the v2.0.4 that we're fixing here, plus another fix for users who are trying to use LLMs in procedures. We recommend upgrading to this version at your earliest convenience.

Fixes

Thank you to everyone who has reported issues in the discord! It has made it much easier to track these bugs down and fix them quickly ๐Ÿ› ๏ธ

What's Changed

New Contributors

Full Changelog: v2.0.4...v2.0.5

Release v2.0.4

11 Mar 18:28

Choose a tag to compare

Hello everyone! This week's release is a small bug-fix patch with a few UX improvements ๐ŸŽ‰

New Features

  • The spacetime CLI now checks daily for updates. When an update is available a notice is posted telling the user to upgrade.
  • The spacetime dev project initialization logic now includes a fuzzy search which makes it much easier to find and select a template.

Bug Fixes

  • Fix spacetime login --token falling through to web login
  • Several correctness fixes which could prevent a database from loading

What's Changed

New Contributors

Full Changelog: v2.0.3...v2.0.4

Release v2.0.3

04 Mar 20:52
5836c26

Choose a tag to compare

SpacetimeDB v2.0.3

We've been getting amazing feedback on our 2.0 release. Today we have a release of small bugfixes and QoL improvements in the CLI and SDK based on some of what we've been hearing. More to come soon!

New features

  • spacetime logs --level filtering. Filter logs by severity with --level warn (that level and above) or --level info --level-exact (exact match only). Works with both text and JSON output. (#4362)

Bug fixes

  • We have improved the latency for making commits durably persisted
  • React: fix useTable isReady stuck on false.
  • TanStack Start: fix useSpacetimeDBQuery returning untyped rows.
  • TypeScript: fix toCamelCase conversion.
  • Fix index truncate edge cases.
  • CLI: preserve leading .. in --out-dir paths.
  • CLI: fix publishing in directories with spaces.
  • CLI: skip upgrade prompt when -y is passed.

C# SDK

  • Improve error messages for Views. Better diagnostics when view queries fail in the C# SDK. (#4435)

What's Changed

New Contributors

Full Changelog: v2.0.2...v2.0.3