Thread-safe data persistence patterns using Swift actors with in-memory cache and file-backed storage.