Best Practices
3. Data Modeling and Sync Logi...
Time-Based Replication
when handling data in fast paced industries, such as airlines, retail, quick service restaurants, and other time‑sensitive environments, implement a design pattern that focuses on efficient memory management and performance optimization time to live eviction strategy a common implementation is the time based replication design pattern , in which you use a time‑to‑live ( ttl ) eviction strategy to set document retention logic; for example, logic specifying that only data written to the local ditto store within the past 24 hours persists on the device example scenario imagine you're developing a meal ordering app that flight attendants use to record passenger meal orders on their devices to ensure that your app remains highly performant throughout its life cycle while also guaranteeing that flight attendants using the app always work with the most recent and relevant information, you specify a ttl of 72 hours so that only documents written to the local ditto store within the past 72 hours persist on the small peer device { "createdat" "2022 09 17t20 00 46 945z", "flightno" "dit101" } the implementation process of the time based replication design pattern with a ttl eviction strategy varies based on your approach to ttl based eviction management big peer management (recommended) — through regular interval http api calls, the big peer cloud deployment delegates all ttl based evictions mesh wide (for instructions, see docid\ klmg3urbh8s7cq qogefz ) by opting for the big peer approach, you ensure that locally stored documents sync with the big peer before eviction small peer local management — each small peer device manages its own ttl based evictions (for instructions, see docid\ omlsjcwo cahjnfaqtcnu )