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

225
Vistas
Is there any way to speed up Fauna DB via configuration etc

We are using faunadb combined with cloudflare workers but unfortunately find it pretty slow.

We are using the classic option for database and have the client configured like so:

const faunaClient = new faunadb.Client({
  domain: 'db.fauna.com',
  secret: FAUNA_SECRET_KEY
});

An example query which gets records from a collection:

return faunaClient.query(
    Map(
      Paginate(
        Documents(Collection(collection)),
        paginateOptions
      ),
      Lambda(x => Get(x))
    )
  );

This collection has around 20 records in and these are the times for getting said collection:

GET /v1/users?limit=2 200 OK (974.23ms)
GET /v1/users?limit=2 200 OK (903.74ms)
GET /v1/users?limit=2 200 OK (1451.97ms)
GET /v1/users?limit=2 200 OK (1228.47ms)
GET /v1/users?limit=2 200 OK (236.18ms)
GET /v1/users?limit=2 200 OK (102.01ms)
GET /v1/users?limit=2 200 OK (567.96ms)
GET /v1/users?limit=2 200 OK (490.67ms)
GET /v1/users?limit=2 200 OK (302.76ms)

Am I doing something wrong or are these times expected?

An example for just retrieving one record:

  const user = await faunaClient.query(
    Get(
      Match(Index('users_search_by_email'), email)
    )
  )

GET /v1/users/331905953155777099 200 OK (386.23ms)
GET /v1/users/331905953155777099 200 OK (368.34ms)
GET /v1/users/331905953155777099 200 OK (298.62ms)
GET /v1/users/331905953155777099 200 OK (96.77ms)
GET /v1/users/331905953155777099 200 OK (396.50ms)
GET /v1/users/331905953155777099 200 OK (247.14ms)
GET /v1/users/331905953155777099 200 OK (175.26ms)
GET /v1/users/331905953155777099 200 OK (146.29ms)
GET /v1/users/331905953155777099 200 OK (313.30ms)

And finally if I create a record:

return faunaClient.query(
    Create(
      Collection(collection),
      {
        data: userBody
      }
    )
  );

POST /v1/users 201 Created (615.84ms)
POST /v1/users 201 Created (419.30ms)
POST /v1/users 201 Created (407.91ms)
POST /v1/users 201 Created (144.86ms)
POST /v1/users 201 Created (836.91ms)
POST /v1/users 201 Created (465.37ms)

Right now I am using the free plan but plan to upgrade to the paid plan. I understand that the queries should be slower due to the strong consistency but I can't seem to match the expected times on faunas website:

https://status.fauna.com/

Latency if I don't make any queries:

GET /v1/users?limit=2 200 OK (7.54ms)
GET /v1/users?limit=2 200 OK (1.61ms)
GET /v1/users?limit=2 200 OK (1.62ms)
GET /v1/users?limit=2 200 OK (1.42ms)
GET /v1/users?limit=2 200 OK (2.37ms)
GET /v1/users?limit=2 200 OK (2.02ms)
GET /v1/users?limit=2 200 OK (2.16ms)

Any ideas what I may be doing wrong?

about 4 years ago · Juan Pablo Isaza
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