https://github.com/clockworklabs/SpacetimeDB Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Customer Stories + White papers, Ebooks, Webinars + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. {{ message }} clockworklabs / SpacetimeDB Public * Notifications * Fork 56 * Star 2.1k Multiplayer at the speed of light spacetimedb.com License View license 2.1k stars 56 forks Activity Star Notifications * Code * Issues 8 * Pull requests 16 * Discussions * Actions * Security * Insights More * Code * Issues * Pull requests * Discussions * Actions * Security * Insights clockworklabs/SpacetimeDB This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 61 branches 7 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/c] Use Git or checkout with SVN using the web URL. [gh repo clone clockw] Work fast with our official CLI. Learn more about the CLI. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @jdetter jdetter and Boppy Upgrade contributor check perms (#194) ... 0f1fdf6 Aug 16, 2023 Upgrade contributor check perms (#194) * Upgraded read permissions for contributor check * Bug fix * Another fix * Changed secret that's used --------- Co-authored-by: Boppy 0f1fdf6 Git stats * 194 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github Upgrade contributor check perms (#194) August 16, 2023 09:48 crates Fix Docker Build (#181) August 12, 2023 09:00 docs/bsatn Initial commit August 1, 2023 23:16 git-hooks test (#1) August 1, 2023 23:17 images Add files via upload August 2, 2023 17:17 modules Move cargo deps to the workspace (#172) August 11, 2023 15:24 test Allow smoke tests to opt out of docker (#154) August 10, 2023 10:47 tools Fixed publish crates script August 12, 2023 18:31 .dockerignore Initial commit August 1, 2023 23:16 .env.sample Sendgrid environment variables can now be configured in dev (#4) August 1, 2023 23:17 .gitignore Forbid unsupported syntax in SELECT & improve sql test suite (#5) August 1, 2023 23:17 .rustfmt.toml Initial commit August 1, 2023 23:16 Cargo.lock Version upgrade to 0.6.1 (#180) August 12, 2023 08:56 Cargo.toml Move cargo deps to the workspace (#172) August 11, 2023 15:24 LICENSE.txt Update LICENSE.txt August 12, 2023 18:36 README.md Install from source instructions (#170) August 10, 2023 12:23 docker-compose-live.yml Removed --allow-create flag (#136) August 2, 2023 17:40 docker-compose-release.yml Removed --allow-create flag (#136) August 2, 2023 17:40 docker-compose.yml Fixed issue with docker-compose August 12, 2023 17:51 run_standalone.sh Remove implicit transactions and thread the Tx instead (#65) August 1, 2023 23:17 rust-toolchain.toml Fix Docker Build (#181) August 12, 2023 09:00 View code [ ] Multiplayer at the speed of light. What is SpacetimeDB? Installation Install on macOS Install on Linux Install on Windows Install with Cargo Installing from Source Running with Docker Documentation Getting Started Language Support Serverside Libraries Client Libraries License README.md SpacetimeDB Logo SpacetimeDB Logo SpacetimeDB SpacetimeDB Multiplayer at the speed of light. [6874747073] [6874747073] [6874747073] [6874747073] [6874747073] [6874747073] [6874747073] [6874747073] [6874747073] [6874747073] 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 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 * Rust * C# (experimental) * Typescript (coming soon) * Python (coming soon) * C++ (planned) * Lua (planned) Client Libraries * Rust * C# * Typescript * Python * C++ (planned) * Lua (planned) 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 propogated 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. About Multiplayer at the speed of light spacetimedb.com Topics database smart-contracts game-development relational-database relational dataoriented Resources Readme License View license Activity Stars 2.1k stars Watchers 22 watching Forks 56 forks Report repository Releases 2 v0.6.1-beta Latest Aug 13, 2023 + 1 release Packages 0 No packages published Contributors 14 * @cloutiertyler * @jdetter * @gefjon * @Centril * @mamcx * @dbrinkmanncw * @drogus * @kulakowski * @kim * @SteveBoytsun * @aasoni + 3 contributors Languages * Rust 95.2% * Shell 4.1% * Other 0.7% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time.