Hello Guys,
Hope all is well.
We are trying to create social graph system using having access to phonebook/contact list from users phone. We will upload this contact list to Nakama storage engine and try to make social graph out of it. So whenever if any users registers laters on to our app and his number is already there in our list so we can recommend it to users who already has that number. Basically, we want players/users to know that his/her friend is registered on platform.
Can any one please let us know how the storage/collections architecture needs to be?
Do each users phone book gets uploaded to single collection+ Single key or Single Collection+ Seperate Key per user, how should it be?
How should we compare this to database when new users signups and his/her contact number is already present in the database so we can recommend quick add to his friend and vice versa?
I also did some research. Most of the social graph based on nodes. Do I able to create node+edge based approached in Nakama?
We have solved the issue by using following scope for those who are interested:
We are saving contact number / mobile number in profile table ( location field - since we are not using this field) during registration
When we get access to contact list / phonebook ( converted in json), we compare those numbers with location field and emails with email field using Lua + Custom sql
This gives us results which numbers and emails are matched with the database. Once we have those results, we recommend them to users for People you may know / quick add feature.
We have created index on location field to avoid whole table scan.
Current issue -
Unable to figure out how to pass array ( whole contact list) in lua
how can we can check whole contact list in single query instead of checking each contact number in loop or divide list in batches and then run them in loop
Currently, we are saving number in +Countrycode_mobilenumber instead of E.164 format which is standard format for phone numbers.
People save phone numbers in different formats like +Country Code + Number , 0 + number , only numbers. So comparing them against database wont be good idea. We will be implementing libphonenumber plugin in CSharp to format/parse/validate number in correct format.
If anybody have suggestions or better way to do it please comment.