Hi all,
in order to send a message to one specific device I tried with the FCM token and it worked flawlessly.
Now, we know that it is good practice not to rely on the FCM mechanism alone, so our app should pull the server in order to request for "recent" messages. The way the pulling is organized depends IMHO on the app's nature.
The question is: given a length of 152 chars (the one I measured) for a token, would it be wiser to index an hash of it on the server so to shorten (hopefully) a query to retrieve recent messages?
I mean, as long as the hash is unique it will behave the same as the more natural indexing on the token itself, but working on a shorter key.
Whenever two distinct tokens could lead to the same hash, the query sub could check the token column against the requested one, so extracting only the expected data.
If you want, my question could be rephrased as: is it advisible to index an hash of the token rather than the token itself?
TIA
in order to send a message to one specific device I tried with the FCM token and it worked flawlessly.
Now, we know that it is good practice not to rely on the FCM mechanism alone, so our app should pull the server in order to request for "recent" messages. The way the pulling is organized depends IMHO on the app's nature.
The question is: given a length of 152 chars (the one I measured) for a token, would it be wiser to index an hash of it on the server so to shorten (hopefully) a query to retrieve recent messages?
I mean, as long as the hash is unique it will behave the same as the more natural indexing on the token itself, but working on a shorter key.
Whenever two distinct tokens could lead to the same hash, the query sub could check the token column against the requested one, so extracting only the expected data.
If you want, my question could be rephrased as: is it advisible to index an hash of the token rather than the token itself?
TIA