3 ms·
Auto-incrementing IDs also leak information. For example, if a service uses an auto-incrementing customer_id column and I'm assigned customer_id 12345, I know t
by jasonshaev 9y ago
Auto-incrementing IDs also leak information. For example, if a service uses an auto-incrementing customer_id column and I'm assigned customer_id 12345, I know there are a maximum of 12344 other customers (making a few assumptions). This information is potentially useful for competitors.
- merb 9y agowhat if I start at a random int number? consider your first customer to be 546472?
- xtreme 9y agoYou can still guess the growth over a period of time.
- jasonshaev 9y agoSure, not a bad idea :) That being said, I can still extract information. For example, I can create a user today, and then another user a week from today. From that information I can extract how many new users a service adds in a week. To avoid that, I can increment by a value other than one, but that might make sharding harder unless I pick a number like 10, 1000, etc. (of course depending on sharding strategy), which is probably easy to figure out. I guess my point is that it's harder to avoid leaking information with auto incrementing IDs. This may or may not matter depending on the use case.