Can i use other databases and other resources beside nakama(postgres or cockroach)

cockroach and Postgres both are SQL databases and even with their advantages still are slower than NOSQL. or even there things like sorting that tools like Redis perform much faster than any database. or if I want to use microservice communication and separate my logic sometimes I need to let my microservices communicate. should this communication only be performed with the Nakama RPC layer or also can I message brokers like RabbitMQ or Kafka.

Nakama only supports PostgreSQL and CockroachDB.

You shouldn’t need additional services or databases for your game backend, the Nakama APIs and the server extensibility via custom RPCs or authoritative matches should give you all you need for your game logic. The APIs are optimized for best performance.

We have successful customers operating games at scale on Heroic Cloud with just our standard Nakama + Postgres/CockroachDB deployment (excluding external auth providers or monitoring systems).

Best.

1 Like

cockroach and Postgres both are SQL databases and even with their advantages still are slower than NOSQL

@virtouso I’ll also add that these kinds of sweeping statements are massively misrepresentative of what performance looks like at scale with our use of CRDB or PG compatible databases.

For example, we’re the only gametech on the market which has independently been audited and evaluated for performance all the way to 2,000,000 concurrently connected players (CCU). You can have a look at our blog post on it for more information. We also have a report available which can be requested for more access to the specific performance numbers we achieved:

https://heroiclabs.com/blog/code-wizards-scale-test-of-nakama-2m-ccu/

All of those performance benchmarks were achieved with SQL. When you carefully write optimal database query code you can achieve massive performance; which is the approach we’ve taken. Hope this helps.

1 Like

@novabyte @sesposito
thanks for reponsing but honestly my main subject is not performance. its jut being able to use other resources on my backend plugin besides Nakama’s main resources.

for example. i need to authenticate a user via his email. i need to validate the email before adding it on the database. redis has a time-limited record that automatically removes data after a few minutes. so for validation, I can send a random password and wait for the user’s response.

there are too many use cases that can cause the use of other resources besides Nakama.

i just need to know if can it be sign of bad design or problematic behavior when making new endpoints on my goland backend plugin.

I understand. I would suggest to avoid additional database resources wherever you can, primarily because its against the design philosophy of Nakama where you have small operational burden and high impact with high performance gametech.

i need to authenticate a use via his email. i need to validate the email before adding it on the database.

This example you give does not require another database at all. It certainly does not need Redis to achieve. The simple steps to achieve what you describe:

  1. Use a service like Resend (or similar) to be able to send an email via an API.
  2. Build an RPC function in Nakama which would send the email in the step (1). Use a JWT with a very short lifetime of a few mins (or usually an hour in this case).
  3. Send the email and have the URL in the email body include the JWT as part of the query parameter.
  4. Receive it back to an RPC function and validate the signature and check the lifetime before the email address has been considered validated.

No need for a database at all, and not Redis as a cache. I appreciate there probably a few use cases where access directly to other databases may be useful but I tihnk they’re fewer than you suggest.

1 Like