[keycloak-dev] Use UUID for IDs

Stian Thorgersen stian at redhat.com
Fri Feb 7 04:12:42 EST 2014

I propose we use java.util.UUID to IDs generated by DB (JPA @GeneratedValue). Reasoning behind this is:

* IDs are the same independent of store used (JPA, Mongo, PicketLink, LDAP, etc)
* Easy to support many RDBMS (some support sequence and/or identity, so it seems the recommended approach when you don't know what the db will be is table)
* IDs can be generated without a "central" db

Also, we'd like to be able to export all data to a json then import into any store. We then need to make sure there's no conflicts in IDs. For example you first use KC with H2, then export all data, import into MySQL, then export all data, import into Mongo. I can see that causing some issues with IDs generated by DB.

This is related to DB issues (Mysql, PostgreSQL not working), Mongo store impl as well as move to using user id instead of username as the reference for a user.

More information about the keycloak-dev mailing list