Browse this repository to see how easy distributed applications development becomes with Restate.
| Language | Name / Link |
|---|---|
| TypeScript | Hello world on AWS Lambda |
| TypeScript | Hello world on AWS Lambda + CDK |
| Java | Hello World HTTP |
| Java | Hello world on AWS Lambda |
| Kotlin | Hello World HTTP |
| Kotlin | Hello world on AWS Lambda |
| Kotlin | Hello world on AWS Lambda + CDK |
| Language | Name / Link |
|---|---|
| TypeScript | Payment API: Example API for payments, inspired by the Stripe API |
| TypeScript (gRPC API) | End-to-end testing: Example of how to test Restate services end-to-end |
| TypeScript | Common patterns Set of common patterns you encounter when developing distributed TS applications |
| Java | Common patterns Set of common patterns you encounter when developing distributed Java applications |
| Language | Name / Link |
|---|---|
| TypeScript | Food ordering - TypeScript: Integrate Restate with external services |
| TypeScript | Ticket reservation: Example showing Restate's keyed-sharding and concurrency guarantees |
| TypeScript (gRPC API) | Ecommerce store: An ecommerce store completely built on top of Restate |
| TypeScript | Dynamic workflow executor: A workflow executor that dynamically executes a list of steps as specified in the JSON input |
| Java | Food ordering - Java: Java food order processing app and driver-to-delivery matching services |
If you want to join the Restate community in order to stay up to date, then please join our Discord. The Discord server is also the perfect place for sharing your feedback with us, learning more about Restate and connect with others!
The readme for each example will explain how to get it running. Once the services of the example are running, the deployment needs to be registered in Restate.
NOTE: Some examples can be run with Docker Compose. For those, you can ignore this section.
For running Restate locally and downloading the binaries, have a look at the options on the Get Restate page.
- To run Restate in a Docker container:
docker run --name restate_dev --rm -p 8080:8080 -p 9070:9070 -p 9071:9071 --add-host=host.docker.internal:host-gateway docker.io/restatedev/restate:latest
- To run Restate with
npx:npx @restatedev/restate-server@latest
- To run Restate with Homebrew:
brew install restatedev/tap/restate-server restate-server
Once Restate is up, register the deployment in Restate by executing:
- Via the CLI:
restate dp register localhost:9080
- Via
curl:curl localhost:9070/deployments -H 'content-type: application/json' -d '{"uri": "http://localhost:9080"}'
When running Restate with Docker, use host.docker.internal instead of localhost for the service deployment URI.
This should give you the following output in case of the ticket reservation example:
{
"id": "bG9jYWxob3N0OjgwODAv",
"services": [
{
"name": "UserSession",
"revision": 1
},
{
"name": "TicketDb",
"revision": 1
},
{
"name": "CheckoutProcess",
"revision": 1
}
]
}When adding a new example:
- Make sure it has a
.gitignorefile and a README - Add it to this README
- Check it's tested both in
test.yamlandpre-release.yaml - Add it to the zips script and
release.yaml
Before releasing, trigger the "pre-release" workflow to update sdk versions. This automatically creates a pull request, which must be manually merged.
Once the repo is ready for the release, push a tag of the form vX.Y.Z.
This triggers a workflow that creates a draft release on Github, which you need to approve to finalize it.