I am currently adding Google Firestore in my app so I can store user preferences, licenses, and other metadata. I have Google Authentication setup as well so I can track whatever the user is registered or not.
Not being a database/NoSQL expert, any design suggestions would be greatly appreciated!
I need to store the following, and probably more later on:
- App installation / license (multiple platforms: iOS, macOS, etc.)
- Bought in-app purchases (for being able to restore them from another platform)
- User preferences, so they can be re-used on another platform and for backup purposes
I am thinking of this simple design:
/users (collection)
|
+-- {user_XXXXXX} <- what should be used here? e-mail? generated ID?
|
+--- app_licenses (collection)
|
+ {license_XXX} <-- incremental id? auto-generated?
| |
| +-- platform : ios / macos / ...
| +-- installation_id : device id ?
+ {license_XXX} <--- incremental id? auto-generated?
| +-- platform : ios / macos / ...
| +-- installation_id : device id ?
|
+--- iap_purchases (collection)
|
+ {iap_XXX} <--- incremental id? auto-generated?
|
+-- name : unique identifier (title/name)
+-- transaction_id
+-- date : purchase date
+--- prefs
|
+ fav_color : red / blue / ...
+ another_pref : ....
Thank you!