Home / Companies / Restate / Blog / Post Details
Content Deep Dive

Graceful cancellations: How to keep your application and workflow state consistent 💪

Blog post from Restate

Post Details
Company
Date Published
Author
Till Rohrmann
Word Count
1,068
Language
English
Hacker News Points
-
Summary

Restate introduces a robust framework for building distributed applications that maintain consistency and resilience against infrastructure faults by utilizing stateful services that interact seamlessly. Each service invocation is captured, logged, and ensured to run to completion, transitioning application states in a controlled manner. A notable enhancement in Restate 0.7 is the introduction of graceful cancellations, which allow ongoing service invocations to be interrupted and reversed through compensating actions, maintaining application state consistency. This feature is particularly useful in scenarios like travel booking applications, where users may need to cancel bookings mid-process, requiring the system to undo actions like flight reservations or payment processing. Restate's approach ensures that these compensations are executed reliably, preserving the system’s consistency even when errors occur. The system's design allows for handling cancellations and TerminalErrors uniformly, leveraging compensations to revert changes and maintain stability. However, in cases where invocations cannot be completed due to deployment issues or incompatible code updates, Restate can terminate invocations, leaving error handling and compensations to the calling services. The platform offers a CLI for managing cancellations and termination of invocations, encouraging users to explore its capabilities and join the community for further development.