MyGit

clockworklabs/SpacetimeDB

Fork: 110 Star: 4398 (更新于 2024-11-16 02:29:15)

license: NOASSERTION

Language: Rust .

Multiplayer at the speed of light

最后发布版本: v0.10.1-beta ( 2024-06-29 00:18:44)

官方网址 GitHub网址

SpacetimeDB Logo SpacetimeDB Logo

SpacetimeDB SpacetimeDB

Multiplayer at the speed of light.

         

 

     

Discord   Twitter   Github   Twitch   YouTube   LinkedIn   StackOverflow


What is SpacetimeDB?

You can think of SpacetimeDB as both a database and server combined into one.

It is a relational database system that lets you upload your application logic directly into the database by way of fancy stored procedures called "modules."

Instead of deploying a web or game server that sits in between your clients and your database, your clients connect directly to the database and execute your application logic inside the database itself. You can write all of your permission and authorization logic right inside your module just as you would in a normal server.

This means that you can write your entire application in a single language, Rust, and deploy it as a single binary. No more microservices, no more containers, no more Kubernetes, no more Docker, no more VMs, no more DevOps, no more infrastructure, no more ops, no more servers.

SpacetimeDB Architecture

SpacetimeDB application architecture
(elements in white are provided by SpacetimeDB)

It's actually similar to the idea of smart contracts, except that SpacetimeDB is a database, has nothing to do with blockchain, and is orders of magnitude faster than any smart contract system.

So fast, in fact, that the entire backend of our MMORPG BitCraft Online is just a SpacetimeDB module. We don't have any other servers or services running, which means that everything in the game, all of the chat messages, items, resources, terrain, and even the locations of the players are stored and processed by the database before being synchronized out to all of the clients in real-time.

SpacetimeDB is optimized for maximum speed and minimum latency rather than batch processing or OLAP workloads. It is designed to be used for real-time applications like games, chat, and collaboration tools.

This speed and latency is achieved by holding all of application state in memory, while persisting the data in a write-ahead-log (WAL) which is used to recover application state.

Installation

SpacetimeDB is an embedded database library that you can use to extend your own applications. You can also run SpacetimeDB as a standalone database server via the spacetime CLI tool.

You can install and run the spacetime CLI tool via Cargo, Homebrew, Docker, or by downloading the binary directly from our website.

Install on macOS

You can install SpacetimeDB on macOS using Homebrew. This will install the spacetime CLI tool and the SpacetimeDB standalone server as a single executable. You can also install on macOS using the Linux instructions below.

brew install clockworklabs/tap/spacetime

Install on Linux

Installing SpacetimeDB on Linux (or other Unix operating systems) is as easy as downloading the binary and running it. You can also install on Linux using the Docker instructions below.

curl --proto '=https' --tlsv1.2 -sSf https://install.spacetimedb.com | sh

Install on Windows

Run the following command in your terminal and follow the on-screen instructions to install the spacetime CLI tool and the SpacetimeDB standalone server as a single executable.

iwr https://windows.spacetimedb.com -useb | iex

Install with Cargo

If you'd like to build the spacetime CLI tool from source, you can install it using Cargo.

cargo install spacetimedb-cli

Installing from Source

For MacOS and Linux this is straightforward. Just run the following commands in a terminal:

# Install rustup, you can skip this step if you have cargo and the wasm32-unknown-unknown target already installed.
curl https://sh.rustup.rs -sSf | sh
# Clone SpacetimeDB
git clone https://github.com/clockworklabs/SpacetimeDB
# Build and install the CLI
cd SpacetimeDB
cargo install --path ./crates/cli --locked

Windows may require some extra dependencies be installed, including openssl and a specific version of perl. A guide for this will be available soon.

Running with Docker

You can execute the spacetime CLI tool using Docker to run the SpacetimeDB standalone server without needing to install any command-line tools or other dependencies.

docker run --rm --pull always --name spacetimedb -p 3000:80 clockworklabs/spacetimedb:latest start

Documentation

For more information about SpacetimeDB, getting started guides, game development guides, and reference material please see our documentation.

Getting Started

We've prepared several getting started guides in each of our supported languages to help you get up and running with SpacetimeDB as quickly as possible. You can find them on our docs page.

In summary there are only 4 steps to getting started with SpacetimeDB.

  1. Install the spacetime CLI tool.
  2. Start a SpacetimeDB standalone node with spacetime start.
  3. Write and upload a module in one of our supported module languages.
  4. Connect to the database with one of our client libraries.

You can see a summary of the supported languages below with a link to the getting started guide for each.

Language Support

You can write SpacetimeDB modules in a bunch of popular languages, with many more to come in the future!

Serverside Libraries

Client Libraries

License

SpacetimeDB is licensed under the BSL 1.1 license. This is not an open source or free software license, however, it converts to the AGPL v3.0 license with a linking exception after a few years.

Note that the AGPL v3.0 does not typically include a linking exception. We have added a custom linking exception to the AGPL license for SpacetimeDB. Our motivation for choosing a free software license is to ensure that contributions made to SpacetimeDB are propagated back to the community. We are expressly not interested in forcing users of SpacetimeDB to open source their own code if they link with SpacetimeDB, so we needed to include a linking exception.

最近版本更新:(数据更新于 2024-10-03 18:42:28)

2024-06-29 00:18:44 v0.10.1-beta

2024-06-14 06:36:20 v0.10.0-beta

2024-05-29 04:49:27 v0.9.2-beta

2024-05-23 06:34:49 v0.9.1-beta

2024-05-03 23:10:41 v0.9.0-beta

2024-02-16 04:48:39 v0.8.2-beta-hotfix7

2024-01-20 00:00:52 v0.8.1-beta

2023-12-09 12:09:40 v0.8.0-beta

2023-11-09 08:21:02 v0.7.3-beta-hotfix1

2023-11-01 08:38:07 v0.7.2-beta

主题(topics):

database, dataoriented, game-development, relational, relational-database, smart-contracts

clockworklabs/SpacetimeDB同语言 Rust最近更新仓库

2024-11-24 11:02:32 lapce/lapce

2024-11-23 21:43:05 gleam-lang/gleam

2024-11-22 05:42:56 lanyeeee/jmcomic-downloader

2024-11-22 01:44:25 surrealdb/surrealdb

2024-11-11 22:51:00 tauri-apps/tauri

2024-11-11 07:55:30 dani-garcia/vaultwarden