Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

178
Vistas
Reduce storage space needed in Nodejs/Expressjs/Feathersjs for the user ID

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).

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

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.

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda