2

One thing that popped out at me immediately when I connected Postgres SQL to my Keycloak realm was that UUIDs, specifically user IDs, are stored as a VARCHAR(36). enter image description here

Sure, it makes sense as VARCHAR is nearly universal between databases and UUID isn't. But I really need not explain why I should be using the UUID type instead of VARCHAR. My question is, what's the best way to do this with Keycloak? Is it even possible to customize the data types like this in Keycloak?

Krusty the Clown
  • 517
  • 6
  • 24

1 Answers1

2

Keycloak uses Liquibase to manage database schemas, so I would say you need custom Liquibase changelogs to customize default DB schema.

See How do i update the Liquibase scripts for the kecloak 12.0.4 image?

Keep in mind that your DB customization might be a problem for future vendor Liquibase changelogs + Keycloak uses Infinispan cache for DB operations, so IMHO DB schema optimization will provide low Keycloak performance improvements.

dreamcrash
  • 47,137
  • 25
  • 94
  • 117
Jan Garaj
  • 25,598
  • 3
  • 38
  • 59