I have not used DynamoDB before, but I just read the iOS documentation on the Amazon website, and I THINK that integrating the two should be possible and relatively easy.
It looks like you are defining data models in DynamoDB just like Realm: create a subclass of AWSDynamoDBObjectModel and add your properties. Since this is so, if you created a Realm Object (or RLMObject in Objective-C) that had the same matching properties, you should (theoretically) be able to simply pass DynamoDB objects directly to Realm to be saved:
let realm = try! Realm() try! realm.write { realm.create(MyRealmSubclass.self, value: MyDynamoDBObject, update: true) }
Realm is very smart at being able to use KVC to check whether any objects correspond to the scheme of the scheme of its model objects and automatically extract and save this information.
(NB: in order for update: work correctly, you also need to ensure that your objects share a common property of the primary key).
From its sounds, if you want to change the locally stored data in Realm when the application is disconnected, and then click this changed data, the device is connected to the network again, then you will need to convert the Realm model objects back to DynamoDB objects in order to return to AWS.
You could add additional Realm model properties, such as the boolean hasChanges flag or the lastModifiedDate date lastModifiedDate , to be able to verify that the stand-alone object has changes that need to be uploaded.
Let me know if you need further clarification!
(Full disclosure: I work at Realm.)
source share