v0.11.0-beta
clockworklabs/SpacetimeDBv0.11.0-betaAug 9, 2024by bfops
AI Summary
This release removes Protobuf for performance and replaces server-side scheduler macros with table-based timers.
Key Highlights
- Removed Protobuf in favor of an internal format for major performance gains.
- Replaced `schedule!` macro with table-based timers.
- New `subscribe` CLI subcommand.
- Reorganization of recovery code APIs.
Breaking Changes
- Old databases cannot be used with this version.
New Features
- Protobuf removal
- Table-based timers
- Subscribe CLI
- Recovery API reorganization
Full Release Notes
We have a big release for you today :tada: :tada: ! We're including some big performance improvements :zap: and long-awaited bugfixes :lady_beetle:! Remember to stay tuned for our 0.12 release soon.
This release includes some major breaking changes, so **you won't be able to use your old databases with this version**. Run `spacetime local clear` to remove them.
# Important changes
## Major
- :zap: We removed our usage of protobuf, in favor of our own internal format (#1077) - this is a **big** performance improvement on the client and the server!
- :hourglass: We removed the server-side `schedule!` macro and its equivalents in favor of table-based timers (#1449). Please check our [server module docs](https://spacetimedb.com/docs) for more info on how to use the new system.
Here is some example code which uses the new timer tables:
```rust
// The `scheduled` attribute links this table to a reducer.
#[spacetimedb(table, scheduled(send_message))]
struct SendMessageTimer {
text: String,
}
// Reducers linked to the scheduler table should have their first argument as `ReducerContext`
// and the second as an instance of the table struct it is linked to.
#[spacetimedb(reducer)]
fn send_message(ctx: ReducerContext, arg: SendMessageTimer) -> Result<(), String> {
// ...
}
// Scheduling reducers inside `init` reducer
fn init() {
// Scheduling a reducer for a specific Timestamp
SendMessageTimer::insert(SendMessageTimer {
scheduled_id: 0,
text:"bot sending a message".to_string(),
//`spacetimedb::Timestamp` implements `From` trait to `ScheduleAt::Time`.
scheduled_at: ctx.timestamp.plus(Duration::from_secs(10)).into()
});
// Scheduling a reducer to be called at fixed interval of 100 milliseconds.
SendMessageTimer::insert(SendMessageTimer {
scheduled_id: 0,
text:"bot sending a message".to_string(),
//`std::time::Duration` implements `From` trait to `ScheduleAt::Duration`.
scheduled_at: duration!(100ms).into(),
});
}
```
## CLI changes
- CLI subcommands consistently use `--server` and `--identity` args consistently instead of anonymous args (#1482)
- We have a new `subscribe` subcommand! (#1343)
- Bugfix: Update help text suggesting `spacetime server fingerprint` to have the correct `-s` param (#1457)
- Bugfix: `spacetime server add` - Remove trailing `/`s from server URIs (#1552)
## Web API
- Recovery code APIs are now under /identity and using POST (#1492)
- /identity GET returns an empty success if the email address is not found (#1491)
## C#
- Use latest C# in BSATN.Runtime (#1548)
- Fixed exceptions in C# SDK when someone disconnects or when a transaction originates from CLI (#1461)
- Include BSATN.Codegen in nuget pack (#1424)
- Generate tagged enums in C# client code (#1421)
- Restructure NuGet packaging (#1440)
- Restructure C# SpacetimeDB runtime (#1455)
- Implement the module rng proposal for C# (#1425)
- Roslyn cacheability testing and fixes (#1420)
## Using SpacetimeDB as a library
- table: Make `with_mut_schema` clone-on-write (#1530)
- Fix running 'cargo test' in crates/lib (#1478)
- Move `db` module from `spacetimedb_sats` to `spacetimedb_lib` (#1479)
- Move schemas to `schema` crate, rename `Def` to `RawDefV8` (#1498)
- core: Simplify custom bootstrap (#1404)
- `TableDef`: clarify `generated_*` methods (#1419)
- Make some commitlog helpers public (#1390)
- perf(1351): Add a row count metric for subscriptions (#1435)
## Bugfixes
- ST sequences: respect allocated amount on restart (#1532)
- Drain scheduler Actor channel before start (#1529)
- `Table::is_row_present`: don't panic (#1526)
- Ignore some sequence allocation mismatches when checking for compatible updates (#1524)
- Fix inconsistent auth/identity creation (#735)
- `ColList`: preserve list order on `list.push(..)` (#1474)
- HACK: Tweak `schema_updates` to allow adding/removing non-unique indices (#1434)
- Fix index removal and additions + add smoketest (#1444)
- fix(1409): Counter metric names (#1411)
- core: Downgrade host log verbosity (#1446)
- Implement a temporary type check validation on sql compiling (#1456)
- core: Replace host scheduler on update (#1453)
# Changelog
* Remove unused file table.rs by @Centril in https://github.com/clockworklabs/SpacetimeDB/pull/1417
* fix(1409): Counter metric names by @joshua-spacetime in https://github.com/clockworklabs/SpacetimeDB/pull/1411
* chore: Remove already tracked subscription counter by @joshua-spacetime in https://github.com/clockworklabs/SpacetimeDB/pull/1412
* refactor: Record txn-level metrics in a single utility by @joshua-spacetime in https://github.com/clockworklabs/SpacetimeDB/pull/1414
* Generate tagged enums in C# client code by @RReverser in https://github.com/clockworklabs/SpacetimeDB/pull/1421
* Include BSATN.Codegen in nuget pack by @kurtismullins in https://github.com/clockworklabs/SpacetimeDB/pull/1424
* `TableDef`: clarify `generated_*` methods by @Centril in https://github.com/clockworklabs/SpacetimeDB/pull/1419
* Add small 'realistic' workload benchmark integration test by @mamcx in https://github.com/clockworklabs/SpacetimeDB/pull/714
* Impl subscribe subcommand & subscription smoketests by @coolreader18 in https://github.com/clockworklabs/SpacetimeDB/pull/1343
* HACK: Tweak `schema_updates` to allow adding/removing non-unique indices by @Centril in https://github.com/clockworklabs/SpacetimeDB/pull/1434
* Update tools/publish-crates.sh by @bfops in https://github.com/clockworklabs/SpacetimeDB/pull/1426
* refactor: Reconfigure histogram buckets for certain metrics by @joshua-spacetime in https://github.com/clockworklabs/SpacetimeDB/pull/1436
* perf(1351): Add a row count metric for subscriptions by @joshua-spacetime in https://github.com/clockworklabs/SpacetimeDB/pull/1435
* Implement the module rng proposal for C# by @RReverser in https://github.com/clockworklabs/SpacetimeDB/pull/1425
* Bump version to 0.10.1 by @bfops in https://github.com/clockworklabs/SpacetimeDB/pull/1443
* Roslyn cacheability testing and fixes by @RReverser in https://github.com/clockworklabs/SpacetimeDB/pull/1420
* Restructure NuGet packaging by @RReverser in https://github.com/clockworklabs/SpacetimeDB/pull/1440
* Fix index removal and additions + add smoketest by @Centril in https://github.com/clockworklabs/SpacetimeDB/pull/1444
* core: Downgrade host log verbosity by @kim in https://github.com/clockworklabs/SpacetimeDB/pull/1446
* Smoketest auto-disconnect after restart by @kim in https://github.com/clockworklabs/SpacetimeDB/pull/1367
* core: Simplify custom bootstrap by @kim in https://github.com/clockworklabs/SpacetimeDB/pull/1404
* core: Replace host scheduler on update by @kim in https://github.com/clockworklabs/SpacetimeDB/pull/1453
* CLI - Update help text suggesting `spacetime server fingerprint` to have the correct `-s` param by @bfops in https://github.com/clockworklabs/SpacetimeDB/pull/1457
* Fix inconsistent auth/identity creation by @coolreader18 in https://github.com/clockworklabs/SpacetimeDB/pull/735
* Fixed exceptions in C# SDK when someone disconnects or when a transaction originates from CLI by @SteveBoytsun in https://github.com/clockworklabs/SpacetimeDB/pull/1461
* Ensure MacOS builds from CI are executable by @kurtismullins in https://github.com/clockworklabs/SpacetimeDB/pull/1462
* Automated Discord post when a PR merges by @bfops in https://github.com/clockworklabs/SpacetimeDB/pull/1470
* Fix C# module smoketests by @bfops in https://github.com/clockworklabs/SpacetimeDB/pull/1475
* smoketests: Add test for module hotswapping by @kim in https://github.com/clockworklabs/SpacetimeDB/pull/1403
* `ColList`: preserve list order on `list.push(..)` by @Centril in https://github.com/clockworklabs/SpacetimeDB/pull/1474
* CLI: Put some common params in a central place by @bfops in https://github.com/clockworklabs/SpacetimeDB/pull/1484
* Implement a temporary type check validation on sql compiling by @mamcx in https://github.com/clockworklabs/SpacetimeDB/pull/1456
* Make some commitlog helpers public by @lcodes in https://github.com/clockworklabs/SpacetimeDB/pull/1390
* Adding benchmark for deserialize json & product value by @mamcx in https://github.com/clockworklabs/SpacetimeDB/pull/1035
* CLI: Use `--server` and `--identity` args consistently instead of anonymous args by @bfops in https://github.com/clockworklabs/SpacetimeDB/pull/1482
* Fix running 'cargo test' in crates/lib by @kazimuth in https://github.com/clockworklabs/SpacetimeDB/pull/1478
* Restructure C# SpacetimeDB runtime by @RReverser in https://github.com/clockworklabs/SpacetimeDB/pull/1455
* Protobufectomy: server by @coolreader18 in https://github.com/clockworklabs/SpacetimeDB/pull/1077
* refactor(1494): Remove SQL DDL per 1.0 SQL spec by @joshua-spacetime in https://github.com/clockworklabs/SpacetimeDB/pull/1499
* C# smoketests use `nuget.config` by @bfops in https://github.com/clockworklabs/SpacetimeDB/pull/1500
* CI - SpacetimeDB PRs run the C# SDK tests by @bfops in https://github.com/clockworklabs/SpacetimeDB/pull/1503
* Timer Table Implementation by @Shubham8287 in https://github.com/clockworklabs/SpacetimeDB/pull/1449
* CI - Post-to-discord workflow only fires if the PR merged to `master` by @bfops in https://github.com/clockworklabs/SpacetimeDB/pull/1520
* Return empty success from /identity GET by @lcodes in https://github.com/clockworklabs/SpacetimeDB/pull/1491
* Moving recovery code APIs under /identity and using POST by @lcodes in https://github.com/clockworklabs/SpacetimeDB/pull/1492
* `Table::is_row_present`: don't panic by @gefjon in https://github.com/clockworklabs/SpacetimeDB/pull/1526
* Move `db` module from `spacetimedb_sats` to `spacetimedb_lib` by @kazimuth in https://github.com/clockworklabs/SpacetimeDB/pull/1479
* Ignore some sequence allocation mismatches when checking for compatible updates by @gefjon in https://github.com/clockworklabs/SpacetimeDB/pull/1524
* Add some helper scripts by @kazimuth in https://github.com/clockworklabs/SpacetimeDB/pull/1501
* Drain scheduler Actor channel before start by @Shubham8287 in https://github.com/clockworklabs/SpacetimeDB/pull/1529
* commitlog: Fix single-commit bitflip test by @kim in https://github.com/clockworklabs/SpacetimeDB/pull/1528
* Bump version to 0.11.0 by @bfops in https://github.com/clockworklabs/SpacetimeDB/pull/1531
* ST sequences: respect allocated amount on restart by @gefjon in https://github.com/clockworklabs/SpacetimeDB/pull/1532
* Don't run bot tests on every master commit whoops by @kazimuth in https://github.com/clockworklabs/SpacetimeDB/pull/1441
* Move schemas to `schema` crate, rename `Def` to `RawDefV8` by @kazimuth in https://github.com/clockworklabs/SpacetimeDB/pull/1498
* `spacetime generate` - make the source args optional by @bfops in https://github.com/clockworklabs/SpacetimeDB/pull/1537
* C#: ignore fields in partial declaration not marked with BSATN attribute by @RReverser in https://github.com/clockworklabs/SpacetimeDB/pull/1545
* ABI BREAK: Add versioning for RawModuleDef by @kazimuth in https://github.com/clockworklabs/SpacetimeDB/pull/1518
* C#: remove `using SpacetimeDB.ClientApi;` by @RReverser in https://github.com/clockworklabs/SpacetimeDB/pull/1546
* broadcast schedule table deletion by @Shubham8287 in https://github.com/clockworklabs/SpacetimeDB/pull/1547
* `spacetime server add` - Remove trailing `/`s from server URIs by @bfops in https://github.com/clockworklabs/SpacetimeDB/pull/1552
* core: Singular system table names by @kim in https://github.com/clockworklabs/SpacetimeDB/pull/1550
* Add ErrorStream combinator by @kazimuth in https://github.com/clockworklabs/SpacetimeDB/pull/1543
* Use latest C# in BSATN.Runtime by @RReverser in https://github.com/clockworklabs/SpacetimeDB/pull/1548
* table: Make `with_mut_schema` clone-on-write by @kim in https://github.com/clockworklabs/SpacetimeDB/pull/1530
**Full Changelog**: https://github.com/clockworklabs/SpacetimeDB/compare/v0.10.1-beta...v0.11.0-beta