I am building a mobile multiplayer game using unity and firebase. I wanted to reduce my real-time database bills.
My app is very social driven:
Friends
Friend Requests
Gifts
Game Invites
etc..
As you know, the firebase way of identifying different users is UID: a 28 characters long alpha-numeric string.
And naturally each tree looks something like this:
friends:
user-uid(28 chars):
friend1-uid(28 chars): true,
friend2-uid(28 chars): true,
friend3-uid(28 chars): true,
....
..
friend_requests:
user-uid(28 chars):
friend1-uid(28 chars): true,
friend2-uid(28 chars): true,
friend3-uid(28 chars): true,
....
..
users:
user1-uid(28 chars):
exp: 28,
username: "example_username",
name: "example_name",
skin: 2,
....
..
To load my friends data on app launch I have to download 28 bytes (to get uid of all my friends) and than search the "users" tree to get their info (again 28 bytes in the key of the snapshot)
My questions:
1) Why is the UID generated is a string 28 characters long?
2) Why can't the UID be alpha-numeric [A-Za-z0-9] that is incremented with each new auth (Creates 56,800,235,584 unique options with just 6 characters [Without even counting the options that are less than 6 characters]).
3) I suppose my question is not going to change the way firebase is generating UID's, so I'd like to know if there are any solid solutions (not messy work-arounds) for these 28 char strings I am stuck with.
Thank you a lot! :)