Using Cloud Storage With SwiftData Custom Data Store

The following videos from WWDC24 say that we can use cloud storage for our SwiftData stores. Video references below:

When watching the videos it shows examples of how we can read and write to a JSON file as a store, rather than using the built in store that comes with SwiftData.

But there are mentions that we can use cloud storage like a backend i.e. a database hosted on a server. The only thing that I'm struggling to figure out and it would be great if we had code samples for this is how to achieve using cloud storage as a store since looking at the current implementations of:

  • DataStoreConfiguration
  • DataStore

The required functions we need to implement look synchronous rather than asynchronous so how would or could we handle fetching asynchronous data from cloud storage. So how would we handle this?

Also it would be great if someone could clarify how or if there is a way to send notifications for changes to your store between different devices similar to CloudKit?

Are there there any plans to provide more documentation & sample code for the questions I've asked above?

Feedback FB13857743

@tundsdev thanks for diving into this (and the great resources you produce)! I'm just jumping on this thread to say I'd love to see someone create a Firebase datastore implementation...

Using Cloud Storage With SwiftData Custom Data Store
 
 
Q