Questions about The main Redash Postgresql Database

Context

We are spinning up a redash v10 cluster (Thank you for all your help as I have asked many questions already). We are at the point of spinning up an AWS RDS postgres (version 13.4) to serve as the main redash database (for queries, query results, events, …)

Questions

  • What is a recommended Postgres version, we are planning on using version 13.4, any issues you know of?
  • I looked at the github repo I could not really find the place where the REDASH_DATABASE_URL , DATABASE_URL, SQLALCHEMY_DATABASE_URI is used to actually connect to the database (I see it referenced in the environment and the docker compose files), Can you point at where it is used, this will answer questions like how is authentication handled (I assume the URI needs a username/password)
  • On the Subject of Authentication, do you support IAM authentication for the main database?

As always, Thank you in advance,
Ramzi

This can be a bit confusing. You can’t see where SQLALCHEMY_DATABASE_URI is used because it’s read by library code, not our application code. Redash uses Flask-SQLAlchemy, an extension to Flask which has access to the app.config dictionary, to connect with the metadata database. Flask-SQLAlchemy expects to find the URI under app.config.SQLALCHEMY_DATABASE_URI.

Redash sets this value in settings/__init__.py here and then sets it on the Flask object here using Flasks’s config.from_object() method.

We never touch the URI again.

Officially Redash is still on postgres 13 but I think @justinclift has done some experiments with Postgres 14 and it works okay.

IAM Auth isn’t directly implemented on the metadata db. But I think this would be trivial to implement if you wanted. We’d happily review a pull request adding it to master :wink:

2 Likes

Thank you so much this was helpful

Ironically, haven’t tested PG 14 with Redash yet. Effort is going into other other, higher importance things first. :slight_smile:

My bad. I thought I saw somewhere you had a fork using PG14. Looking through thought I don’t see it any longer