This question isn't related exactly to coding and also could be in the B4A forum, but since the doubt has arised in a B4J program that I am writing, here it goes.
This program is a server that communicates through UDPSockets with several devices running an app made with B4A.
The server has to be able to add, delete users, and also manage a list of "accepted friends" for each user
Up to now, and for debugging the rest of features, I had a file with some predefined users and all of them were allowed to comunicate with the others (so I didn't have to worry about this part)
But now I would like to use a database for a real approach. I'm quite new into this part
Which would be the most appropiate structure for a DB in which what I want is this:
a) Have a list of users (which allows me to insert, delete, modify...)
b) Each user has a number of friends. This number is different for each user (and also must allow to add, delete friends...)
I think structure of a table for a) is quite easy (user fields are finite and well defined: unique ID, mail address and nick) . But don't know which would be better for b) since for each user there may be different "friends" so the number of fields for each register (user) is not known
Even if the question may be obvious (sure) , a hint other than keep on reading manuals will be welcome.
Thanks!
This program is a server that communicates through UDPSockets with several devices running an app made with B4A.
The server has to be able to add, delete users, and also manage a list of "accepted friends" for each user
Up to now, and for debugging the rest of features, I had a file with some predefined users and all of them were allowed to comunicate with the others (so I didn't have to worry about this part)
But now I would like to use a database for a real approach. I'm quite new into this part
Which would be the most appropiate structure for a DB in which what I want is this:
a) Have a list of users (which allows me to insert, delete, modify...)
b) Each user has a number of friends. This number is different for each user (and also must allow to add, delete friends...)
I think structure of a table for a) is quite easy (user fields are finite and well defined: unique ID, mail address and nick) . But don't know which would be better for b) since for each user there may be different "friends" so the number of fields for each register (user) is not known
Even if the question may be obvious (sure) , a hint other than keep on reading manuals will be welcome.
Thanks!