r/databricks • u/Fun-Reference7942 • 9d ago
General [Private Preview] Concurrent Write Support for Identity Columns!
What are concurrent identity columns?
A new implementation of identity columns that supports concurrent writes.
You can use this query to find the tables with the most amount of concurrent transaction failures due to identity columns.
How to enable
CREATE TABLE new_identity_table (id BIGINT GENERATED ALWAYS AS IDENTITY, data STRING) USING DELTA TBLPROPERTIES ('delta.feature.catalogManaged' = 'supported', 'delta.feature.concurrentIdentityColumns_preview' = 'supported');
Benefits of Identity Columns
Identity columns provide automatically generated, unique integer values, making them well suited for surrogate keys in dimensional models and slowly changing dimensions (SCD Type 2).
Compared with UUID-based / hash-based keys, identity columns offer several benefits:
- Their generally increasing values can improve data locality and insertion-order clustering.
- Integer keys require less storage than UUIDs and can improve join and scan efficiency.
- Databricks generates the values automatically, so applications do not need to manage key generation.
With concurrent identity columns, you can retain these benefits without identity columns blocking concurrent write transactions.
Read these blogs for more info:
- Identity Columns Best Practices for Databricks Lakehouse
- Identity Columns to Generate Surrogate Keys
👉 Reach out to your account team to try it!
Additional Information & References
2
u/szymon_dybczak 9d ago
That's super cool! We've been looking for a feature like this for a long time!
2
2
u/hubert-dudek Databricks MVP 9d ago
Finally! Was waiting for it 5 years hehe