Hi! We use hydra (and kratos) as part of our Stack...
# talk-hydra
w
Hi! We use hydra (and kratos) as part of our Stackspin project. We're failing to upgrade to hydra
0.26
because the database migrations are apparently not compatible with MariaDB. Is this something hydra developers might be willing to fix, or should we give up and move to a different database backend? We actually moved from postgres to mariadb earlier because postgres was a pain to upgrade automatically, which is a requirement of our setup (many self-managed auto-updating instances).
m
Hello Arie, It seems Hydra has issues with certain MariaDB versions https://github.com/ory/hydra/issues/377 I am not sure how well MariaDB is supported, as it is not mentioned in the docs https://www.ory.sh/docs/ecosystem/deployment#sql-persistent - but should be possible… Can you link the version that you are upgrading to? I am not sure what 0.26 is 😅
w
Oh right sorry, that's the helm chart version. The hydra version it uses is
v2.0.1
.
I upgraded MariaDB to a very recent version (
10.10
), because they recently added support for a function used in another hydra db migration.
But then a later hydra migration uses the
CAST ... as json
construct which MariaDB doesn't -- and won't -- support (because its json type is actually an alias for a string type).
m
Hm tbh I am not familiar with MariaDB at all, so not able to help you there 😓 We do have a brief upgrade guide, did you find that? https://www.ory.sh/docs/hydra/self-hosted/upgrade#migrate-from-hydra-v1-to-v2 https://github.com/ory/hydra/releases/tag/v2.0.0
w
Right, the upgrade guide doesn't mention this. You'd only hit this if using MariaDB. MariaDB is the widely-used completely open source fork of mysql, I assume created aroudn the time mysql was bought by Oracle and became more commercial. It's mostly compatible, but clearly not 100% 😞.
I'm aware that hydra doesn't claim MariaDB compatibility, which is why I wanted to ask if you are at all willing to aim for such compatibility, or if that's a lost cause and we should switch some component (probably the database).
m
AFAIK there are no plans at the moment to add full compatibility with MariaDB. I would say the best option would be to switch to one of the fully supported dbs: PostgreSQL, MySQL, CockroachDB (and SQLite). Issues with those will get fixed. I am not sure if we would accept a PR that adds compatibility with MariaDB. If you want to explore that option, I suggest to open a feature request or design doc on ory/hydra Take it with a grain of salt as I am no expert in databases 😄
w
Alright thanks! That's a pity because I feel MariaDB better matches your company position/values, but it's completely up to you. Expanding the set of supported databases means increased development work so I definitely understand your position. I doubt we'll create a PR to fix MariaDB compatibility, mostly because of the associated maintenance cost of fixing future migrations etc. So probably we'll have to switch databases -- again.
m
Hey Arie, I see, I just talked to the dev team and MariaDB support is not planned and wont be added in the foreseeable future I agree that adding support on your own would most likely be much more work than switching database. Apologies for the hassle! Let us know how it goes 🙏
w
Thanks for the confirmation!