L
L
Ler Den2018-04-07 22:51:24
Web development
Ler Den, 2018-04-07 22:51:24

Is it possible to send the id (primary key) of a record from a table to the client?

Somewhere I heard that you cannot send the id (primary key) of the record from the database table to the client. Why is that? Sometimes it is convenient to send it. For example it is necessary to make loading of the new data. We send the id of the last loaded record to the backend, and in the database we select everything that is greater / less than this id.
1. What is the insecurity of storing the key on the client of the method?
2. If a part of the database is public (the database is essentially a directory), that is, anyone can log in and see what keys each entry has, then it makes no sense to hide the key from the client.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Armenian Radio, 2018-04-07
@givemoneybiatch

Why and when not to do this - if those id's somehow identify the data you'd like to hide. For example, the number of your customers - by changing their id, a competitor will be able to find out the range of valid ids, and thus find out the size of your customer base.
If you drive salted hashes, the competitor can only break off.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question