I have a medium sized schema which has nested maps which if flattened comes to about 20-25 separate fields. I want to know what is the industry approach and standard. Should it be saved flattened or should it be saved nested as binary data + codable. Also one more thing to keep in mind is we are trying to keep it similar across android and iOS
Industry standards for core data
I think how large your dataset is and how you'd access the dataset matter here. If your dataset is relatively large (so you can't load all the data into memory) and you would query the data with the fields using general database technology, persisting all the fields into binary data won't work, because binary data is typically not searchable in a database.
If the fields are something like settings in UserDefaults, which you can easily load into memory with your own type, binary data + Codable will be a great choice.
Since you tagged your post with Core Data, I think it's worth mentioning that Core Data is only available in Apple's platforms.
Best,
——
Ziqiao Chen
Worldwide Developer Relations.