Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

An experimental distribution of Temporal that runs as a single process

License

Notifications You must be signed in to change notification settings

temporalio/temporalite-archived

Repository files navigation

Temporalite

Go Reference ci codecov

⚠️ This project is deprecated and no longer maintained, we recommend using the Temporal CLI dev server instead. ⚠️

Temporalite is a distribution of Temporal that runs as a single process with zero runtime dependencies.

Persistence to disk and an in-memory mode are both supported via SQLite.

Check out this video for a brief introduction and demo: youtu.be/Hz7ZZzafBoE [16:13] -- demo starts at 11:28

Why

The primary goal of Temporalite is to make it simple and fast to run Temporal locally or in testing environments.

Features that align with this goal:

  • Easy setup and teardown
  • Fast startup time
  • Minimal resource overhead: no dependencies on a container runtime or database server
  • Support for Windows, Linux, and macOS
  • Ships with a web interface

Getting Started

Download and Start Temporal Server Locally

Download and extract the latest release from GitHub releases.

Start Temporal server:

temporalite start --namespace default

At this point you should have a server running on localhost:7233 and a web interface at http://localhost:8233.

Use CLI

Use Temporal's command line tool tctl to interact with the local Temporalite server.

tctl namespace list
tctl workflow list

Configuration

Use the help flag to see all available options:

temporalite start -h

Namespace Registration

Namespaces can be pre-registered at startup so they're available to use right away:

temporalite start --namespace foo --namespace bar

Registering namespaces the old-fashioned way via tctl --namespace foo namespace register works too!

Persistence Modes

File on Disk

By default temporalite persists state to a file in the current user's config directory. This path may be overridden:

temporalite start -f my_test.db

Ephemeral

An in-memory mode is also available. Note that all data will be lost on each restart.

temporalite start --ephemeral

Web UI

By default the web UI is started with Temporalite. The UI can be disabled via a runtime flag:

temporalite start --headless

To build without static UI assets, use the headless build tag when running go build.

Dynamic Config

Some advanced uses require Temporal dynamic configuration values which are usually set via a dynamic configuration file inside the Temporal configuration file. Alternatively, dynamic configuration values can be set via --dynamic-config-value KEY=JSON_VALUE.

For example, to disable search attribute cache to make created search attributes available for use right away:

temporalite start --dynamic-config-value system.forceSearchAttributesCacheRefreshOnRead=true

Development

To compile the source run:

go build -o dist/temporalite ./cmd/temporalite 

To run all tests:

go test ./...

Known Issues

  • When consuming Temporalite as a library in go mod, you may want to replace grpc-gateway with a fork to address URL escaping issue in UI. See #118