goldmansachs/reladomo

Support for UUID

kutabale opened this issue · 5 comments

Is there a way to support UUID as primary keys.

Do you mean DB generated, or app generated? Neither is supported out of the box, but the latter should be relatively easy to add by yourself.

UUID as PK is suitable for applications that keep the same schema in multiple databases as it guarantees uniqueness across them. However, that's not a very efficient solution. Reladomo provides the ability to address multiple databases with the same schema without confusing rows that have the same PK using the "source attribute" concept. That way, you can use a simple integer for a PK, which is around 10x more efficient than a UUID (storage, comparison, etc).

Can you point to some documentation or at some example on how to add uuid to the model and or how to use "source attribute"?

You'll need to do the following with a source attribute:

Thank you for your answers, few more questions:

Is there a notion of interception similar to Interceptor in Hibernate?

We are looking to use the library because of its bi-temporal chaining, how does source attribute integrates with bi-temporal data?

There is an update listener. See the advanced docs slide 17.

Source attribute is an orthogonal concept to bi-temporal data: they work together without interference.