Connect a Node.js app to an external database | NodeFlux.eu Docs

Use an external database safely without assuming NodeFlux provides a managed database for customer apps.

Steps

  1. Create or obtain an external database from a provider you control and collect its host, port, database name, username, password, and TLS requirements.
  2. Store the connection string or individual settings as protected application configuration, not in source code.
  3. Configure your database library with connection pooling and a connection timeout appropriate for a small service.
  4. Start the app and verify it connects without logging credentials or full connection strings.
  5. Keep independent database backups and test restoring them with a non production copy when possible.

Notes

Warning

Do not expose a database directly to the public internet without provider firewall rules, strong credentials, and TLS where supported.