databasemobiledatabase-designparse-platformrelational-database

Storing user contacts on server database (parse.com)


My question is about database design.

I am storing user contacts on server(Parse.com) by making a class named the phone number(example. +917534310478) & within that 1 column of names & 1 column of its corresponding phone number.(This method will not work because in parse.com class name does not begin with + or a number, so I am making the class name as India7640985766)

By using this style I will have millions of classes if I have millions of downloads.

I think this is not a good type of design concept.

I have studied about foreign key/ primary key in RDBMS, etc.

As I do not have much experience so I am really confused about designing this type of database.

Basically I am making a functionality similar to truecaller in my app.

Any help is appreciated about the database design,

Thanks


Solution

  • Parse have class named USER(_USER) - You have to use this only if want to use default Login/SignUp functionality of Parse.

    Better you store your each Contact Number as UserName in USER class.

    For managing list of friends you can specify column of type Array & store all friends'(which will ObjectIDs from USER class only.) ObjectId(s) as elements of that Array.

    So whenever you need to fetch friends of any Contact then you can query them by their ObjectId. For CountryCode better you manage another Column with String datatype.