Re: Is it possible thousands of desktop apps to work with 1 mysql server on interrnet?
Posted by:
Zero-G. _
Date: December 29, 2014 03:58AM
Hey
Not sure, if you still Need advise, but this could be done very easy.
You would Need a table, let's call it "ProgrammUser"
It basicly could look like this:
Id as BigInt
Name as varchar
Password as varchar (of course this should be encrypted)
And then you do have a nother table, where you hold the structure for Customers for example. - So let's call this table "ProgrammCustomers"
There you could have the following structure
Id as BigInt
ProgrammUserId as BigInt
FirstName as varchar
LastName as varchar
BirthDate as Date
Now you could set a foreign key between ProgrammCustomers.ProgrammUserId and ProgrammUser.Id
This was for the database. - Now you only have to check, if the logged in user on your Client has the "Id" of thre ProgrammUserId field and allow or disallow deleting.
Of course in real life, this would be a bit mor tricky, but the way would be the right one.
What you have to check would be: Having the Id fields as BigInt or as GUID
GUID would be the better Approach, but would use more Memory to find all related rows (even you have more than 1000's users! - Or would each user just handle 500 rows, than this would not be a bottle neck)
GUID would have the Advantage, that on Client side not a fixed 64 Bit Integer would be present, - Means that, when I know my Id is 5, the possibility, that there is a user with the Id 6 is very high. - But when I get a 32 Bit length of String, I can't calculate somebody elses id (this easy)
Have a nice day - Hope this would help