3 ms·
My understanding from Stripe was that they're stored with the prefix as text in the DB, but I might be wrong. As for doing the translation at the API boundary,
by carderne 2y ago
My understanding from Stripe was that they're stored with the prefix as text in the DB, but I might be wrong.
As for doing the translation at the API boundary, my only gripe is that it's likely to be error-prone: every dev needs to remember to add/strip the correct prefix in every route. Of course you can add some middleware that is context-aware, but still there will be cases (eg live querying while talking to non-tech team) where not having to translate back-and-forth would be great!
Anyway, appreciate the comment and definitely agree that for most teams just using a UUID and adding a bit of code is a more obvious route than using a new ID format someone just made up!
- tdb7893 2y agoAs someone who has done that exact sort of stripping at a previous job it's not that bad. If you mess it up your tests immediately fail but also it's just so easy to have a library that does it for you