Hacker News
new
top
best
ask
show
job
Ask HN: Should IDs be strings or numbers in your codebase?
2 points
by
viviansolide
6 hours ago
2 comments
Rotundo
5 hours ago
Consider storage requirements. Strings (ASCII? UTF-8?) are not as efficient as integers or UUIDs. You're not storing UUIDs as strings, are you? They are
binary
, only converted to the string expansion for display and/or export.
jghn
6 hours ago
Unless you're doing math with them for some reason, they're strings.