When Should I Store a Topic in the SOW?
Storing a topic in the State of the World is most useful when your application needs to use the current state of the data being tracked. Storing a topic in the State of the World can be especially useful if your application would benefit from automatically receiving updates as soon as they are made (described in more detail in the Atomic Query and Subscribe topic).
Below you will find common uses of a SOW topic, which include examples of practical use cases:
An application needs the current state of a record, but does not need to recreate the message flow that created that record:
An order fulfillment system presents a view of all currently pending orders when the application starts up.
An application needs the current state of a record or set of records, even when the topic is high-volume or quickly changing:
A warehouse management application locates the current inventory level for a product.
A taxi dispatch company locates taxis currently within 10 blocks of an event.
An application wants to be able to publish incremental updates to a record:
A customer updates her shipping address. All pending orders for the customer are automatically updated without affecting any other information in the order, and processors working with the orders are notified of the change.
An application wants to receive only the changed fields of a record:
A mobile application displays the status of an order as the order progresses through the stages of validation: the application receives only the identifier for the record and the changed fields.
An application needs the AMPS server to calculate values based on the current values of a record or set of records:
A management console constantly calculates the real-time value of pending orders. The console uses a view, calculated based on data saved in a topic in the SOW.
An application wants to store application state for quick retrieval:
An order processing system publishes statistics on each step of the process: a separate process monitors and aggregates those statistics. The SOW also maintains historical state for the topic so the monitor can easily recreate a snapshot of the state at a point in time and compare day over day status.
Of course, the examples above are just a small sample of the ways the AMPS SOW can be used.
Last updated