Release announcement: Restate 0.7 is here 🎉

Posted January 16, 2024 by Till Rohrmann and Ahmed Farghal and Giselle van Dongen and Pavel Tcholakov ‐ 5 min read

A new version of Restate has been released with some really cool new features. Go and get Restate while it is still fresh.

We would be super delighted if you tried it out and gave us feedback via Discord to make Restate better!

Introducing the Restate CLI

We love using the command-line at Restate and in this release we are excited to share the first public version of the restate CLI that makes managing services, invocations, and deployments significantly easier. Have a look at the CLI docs for information on how to install and configure it.

The CLI gives you an intuitive way of interacting with Restate. For example, it lets you register new deployments:

restate deployments register <SERVICE_DEPLOYMENT_URL>

Registering service deployments with the CLI.

It also gives you insight in the registered services, deployments, methods, and ongoing invocations. For example, to get a summary for a specific service, you can do:

restate svc status <SERVICE>

On top of that, you can use the CLI to inspect and debug ongoing invocations. For example, there are some invocations which are not making progress and you want to debug what’s going on:

restate invocations list --oldest-first --status pending,backing-off,suspended

Or you notice that an invocation for a specific key has stalled, so you want to list the invocations that are blocking that key:

restate invocations list --key <KEY> --service <SERVICE>

You can even use -w to continuously watch invocation updates every second. You can inspect a single ongoing invocation for a detailed view of its status:

restate inv describe <INVOCATION_ID>

Inspecting ongoing invocations shows their status and progress.

Have you noticed that we used inv as a short form of invocations? Yeah, we also thought that you’ll like that too.

These commands are just a small glimpse of what you can do with the CLI. For more useful commands, have a look at the CLI docs and the introspection docs. And more importantly, try it out yourself!

Bootstrapping Restate projects with one click

Each SDK now has a template project to help you bootstrap a fully working Restate project. You can use the CLI to get started with a single command. For example, to bootstrap a Lambda project using the TypeScript SDK, run the following command:

restate examples typescript-hello-world-lambda

We also added more examples for the Java and Kotlin SDK which you can explore and download via the CLI as well.

New ways to install Restate

Starting with this release we are offering a few more ways to install Restate’s CLI and server. This is enabled by the new native builds for MacOS and Linux. You can find all the binaries on our new download page.

Install via Homebrew

# Installing CLI
brew install restatedev/tap/restate
# Installing server
brew install restatedev/tap/restate-server

Run via npx

# Run CLI
npx @restatedev/restate
# Run server
npx @restatedev/restate-server

Official Docker image

The official Restate docker image can now be found on DockerHub.

docker pull docker.io/restatedev/restate:latest

Cancel your invocations if they are no longer needed

Restate guarantees that your invocations will run to completion. However, in some cases invocations might no longer be of interest or could be stuck because an external system is not responding. In these situations, you might want to stop executing the invocation while keeping the overall system state consistent. With cancellations, this becomes possible.

A cancellation signals your invocation to gracefully stop and to run compensating actions once the child invocations have been cancelled. These compensating actions are also executed durably which guarantees that they complete and leave the overall system in a consistent state. You can use our new CLI to trigger cancellations:

restate invocations cancel tu0cRfLsJ4UAYyIMqc5fD2nyc98VnPvjg

As a last resort if there is no way to run the compensations for an invocation, you can also kill the respective invocation. Killing an invocation immediately stops executing the invocation and all of its child invocations. The only thing you need to do is to pass the --kill flag when cancelling an invocation.

restate invocations cancel --kill tu0cRfLsJ4UAYyIMqc5fD2nyc98VnPvjg

Learn more about invocation cancellation in our docs.

Deploying Restate to the cloud via CDK

The AWS Cloud Development Kit (CDK) provides an elegant way to manage your cloud infrastructure in a familiar programming language. Restate supports CDK projects built in TypeScript, but you can deploy Restate handlers in any language supported by a Restate SDK.

Restate’s CDK support makes it easy to deploy Restate service handlers on AWS Lambda and register them with either a managed Restate environment, or one that you host yourself. Additionally, we include a simple construct to deploy a single-node Restate environment on Amazon EC2.

npm install @restatedev/restate-cdk

You can use the CDK constructs to easily deploy both Restate itself and service handlers on AWS Lambda – and register these deployments with a Restate environment. Here is what this looks like in code:

import * as restate from "@restatedev/restate-cdk";

const environment = new restate.SingleNodeRestateDeployment(scope, "Restate", {
  tracing: restate.TracingMode.AWS_XRAY,
  logGroup: new logs.LogGroup(scope, "RestateLogs"),
});

new restate.LambdaServiceRegistry(scope, "RestateServices", {
  environment,
  handlers: {
    Example: new NodejsFunction(scope, "ExampleService", {
      runtime: lambda.Runtime.NODEJS_LATEST,
      entry: "handler.ts",
    }),
  },
});

This code will create a standalone Restate environment in your AWS account, and register a Lambda service handler with it. For more information about the available constructs and how to use them, please see the Deploying to AWS Lambda with CDK documentation page and @restatedev/restate-cdk on npm.

Making Restate faster

This release includes a couple of performance improvements. While we are just getting started, we were able to significantly improve the overall throughput of Restate while providing the highest durability guarantees. The main improvements happened in the storage layer and in command processing.

If you are interested in learning more details about how we want to further improve Restate’s performance, then check out the performance umbrella issue.


Join the community and help shape Restate!

Join our Discord!