Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major rework of the examples. #109

Closed
wants to merge 43 commits into from

Conversation

StephanEwen
Copy link
Contributor

@StephanEwen StephanEwen commented Feb 29, 2024

Main changes

  • Restructures the categories
  • Adds Basic Examples (durable execution, virtual objects, event processing, ...)
  • Add Durable Promises example
  • Add sync/async payment example
  • Reworks some examples to be simpler. Focus on the essentials, minimize noise around that (optional files, comments, etc.)
  • Adjusts all TypeScript example for release 0.8
  • Remove workspaces, because they make it impossible to install / build typescript examples individually when checking out the whole repo (everything goes down into workspace modules, package-lock, etc.). Makes for a weird and puzzling experience at first.

Browse the new layout here: https://github.com/StephanEwen/restate-examples/tree/major_rework?tab=readme-ov-file

Structure

The structure of the examples is as follows (copied from the README)

A collection of examples that illustrate how to use Restate to solve common application
challenges.

  • Basics: Small examples highlighting the basic building blocks, like
    durable execution or virtual objects.

  • Use Cases and Patterns: Small specific use cases, like webhooks,
    workflows, asynchronous task queuing.

  • End-to-End Applications: Runnable demo applications that consist
    of many components, e.g., a fodo ordering app, or an e-commerce site.
    Typically packaged as a docker compose setup.

  • Tutorials: A step-by-step guide that builds an application and introduces
    the Restate concepts on the way.

  • Templates: Project templates for various languages and build systems.
    Simple 'Hello World!' examples in a proper build setup that you can use if you want to start
    a brand new project for a service or lambda that will be invoked through Restate.

Examples by Language

The majority of the examples currently exist as TypeScript versions, Java versions are catching up.
Here is a (incomplete) list of examples per language.

TypeScript

Type Name / Link
Basics Workflows, Durable Execution, Event-processing, Virtual Objects
Use Cases Sagas
Use Cases Durable Promises
Use Cases State Machines
Use Cases Payment Service
End-to-End Food Ordering App
End-to-End AI Image Processing Workflow
End-to-End Online Shop
Tutorial Tour of Restate
Templates Restate Node/TS Template

Java

Type Name / Link
Use Cases Sagas
End-to-End Food Ordering App
Tutorial Tour of Restate
Templates Restate Node/TS Template

Kotlin

Type Name / Link
Templates Restate Node/TS Template

Scala

Type Name / Link
Templates Restate Node/TS Template

@StephanEwen
Copy link
Contributor Author

Assumptions for reviewers to verify

  1. I moves to the philosophy of having minimal files/noise in the example repos, so generally no .eslintrc, .gitignore, etc.
  2. We don't need every example to be downloadable three ways, and don't need to spell that out in every example
  3. Folks know how to work with zips. We put a link to the zip, but don't prepare the wget / unzip / cd / rm sequence for them.

@StephanEwen StephanEwen force-pushed the major_rework branch 2 times, most recently from 529c554 to 2a042c3 Compare March 1, 2024 00:24
@pcholakov
Copy link
Contributor

I like the new layout a lot! Something missing that I think deserves its own top-level category is a "infrastructure and deployment automation" section to house things like Kubernetes and AWS/CDK recipes. Unlike the templates, we can go into more details and showcase available options there. I don't think we should use end-to-end applications to showcase the deployment aspects; they should be self-contained and easy to deploy/run, but we should be focused rather than comprehensive there.

@slinkydeveloper
Copy link
Contributor

I think this can be closed as it was solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants