97 Things Every Cloud Engineer Should Know by Emily Freeman

97 Things Every Cloud Engineer Should Know by Emily Freeman

Author:Emily Freeman
Language: eng
Format: epub
Publisher: O'Reilly Media
Published: 2020-12-04T00:00:00+00:00


Keeping State

Stateful servers are servers that keep track of processed messages. These messages should be identified with some metadata, not with the payload itself. This is very important to distinguish between repeated messages and messages with equal payloads. When creating a message, attach an identifier attribute that makes duplicates explicit.

As in stateless servers, if there is a time window after which processing a message is no longer required, create a time-to-live header so that old messages may be forgotten, reducing the effort of keeping state and checking whether a message was processed.

If the state is stored in an ephemeral structure, the same rules applied to stateless servers apply to stateful servers. If the state is lost or incomplete, the service may not be aware it is receiving a duplicate.

When a service with several instances processes messages in parallel, it may be necessary to share state among them, usually with the help of a database. The choice of the state persistence stack depends on the reliability/performance axis that is part of the decision making.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.