Why should I map external IDs to internal IDs in my API?

We have a public API. Users will call this API by passing in different Guids as the IDs for entities. In the API, the Guid will be translated to the internal ID (Int32) for that particular record in our DB.

The public API calls our internal API and the internal API receives this internal ID to fetch the record from the DB.

I understand why Guids are used, because malicious users can't guess a valid ID for some random record.

But why do we need to translate them to internal IDs? If our DB tables have ExternalId and InternalId, couldn't either one be used internally to fetch a record?

submitted by /u/backwards_dave1
[link] [comments]

from Software Development – methodologies, techniques, and tools. Covering Agile, RUP, Waterfall + more! https://ift.tt/XoyBNsz

Leave a comment

Design a site like this with WordPress.com
Get started
search previous next tag category expand menu location phone mail time cart zoom edit close