State-Based Replication
2min
A common design pattern is to build state into each document type. In an ordering application, orders go through a lifecycle.
![Document image Document image](https://images.archbee.com/qoRkNxW5fJ81r_NqVpc8C/6K63iZXcts_x8jLqcF-Um_phasesorders.png?format=webp)
When the application starts, the device only wants to synchronize orders that are not filled or canceled and evict any orders that have been completed.
Once an order has been completed, document as “FILLED”. Live queries execute and update the front-page.
Updated 12 Mar 2024
Did this page help you?