I am working on my first nodejs based project using Feathersjs as a backend and Vue as frontend. When I look in the database then the user ID is a character string looking something like this: "IXS1rCoGogkdOOss".
This seems like it will use more storage space than needed, when a integer user id would suffice.
Can the storage space requirement be reduced somehow?
Perhaps by having the user ID stored as an integer in the database instead of a text string?
I have tried to look through the code but I can not find where the user ID assignment occurs. I am new to both javascipt and node.js and I just can't get my head around this. Searching this site and googling also turned up nothing.
And the reason why it seems like a good idea to reduce the storage size of the user ID is that this will be a multi tenant SaaS with less than 10k users but close to a billion rows containing the user ID.
Thanks for the help!
Edit
I will be using Postgres in production, but have been using NeDB to try things out initially.
The tables with many rows in them consists of 3 int values plus the primary key (which is a int + user ID).
This depends entirely on the database you are using. MongoDB, Mongoose use MongoDB ObjectIds and NeDB uses a similar value. For those databases it is not trivial to change the primary id to something else.
An SQL database - which can be used through the Sequelize or KnexJS adapters - usually uses integers as the primary key.
In the grand scheme of things if your database entries consist of anything more than a single other value, the number of characters in the id property does not really matter that much when it comes to actual size though.