One more brick: Dynamic Views

One more brick: Dynamic Views

In the realm of data management, especially in environments where a consumption layer is accessible to end-users or various systems, security becomes a important aspect. Databricks offers effective solutions for this purpose, enabling the implementation of security measures at both the row and column level, as well as the use of data masking.

A powerful tool in this context is the ability to use Unity Catalog to centralize data access policies. This not only simplifies security management but also provides us with advanced functionalities, such as the predefined functions current_user(), is_account_group_member(<group name>) and is_member(<group name>) . It's crucial, when granting access to a specific table, to protect the integrity and security of the underlying data by avoiding direct access to the source tables of dynamic views.



Column-Level Permissions

With dynamic views, we can limit access for certain users and protect or impose additional restrictions on a specific set of columns.


Columns Level Permission Example


All users with read and access permissions on sales_redacted can view its content, but only members of the 'auditors' group can see the content of the 'email' column.


Row-Level Permissions

In addition to filtering access at the column level, it is possible to limit access to the complete dataset by using the mentioned functions as predicates in queries.

Row Level Permissions Example


Here, only members of the 'managers' group will see all records, while other users will have limited access.


Data Masking

All security functionalities are accessible through Spark SQL. Data masking, using functions like regex and replace, allows hiding data from end clients.


Managing permissions is key to ensuring that security and access policies are effective.

  • GRANT SELECT ON VIEW sales_redacted TO 'auditors';
  • GRANT USAGE ON VIEW sales_redacted TO 'auditors';
  • ALTER GROUP auditors ADD USER '[email protected]';
  • ALTER GROUP auditors ADD GROUP 'other_auditors_group';

These commands allow for effective administration of security in Databricks.


Data access rules are priority in any data management environment, and Databricks offers a robust set of tools to ensure it. By using permissions at the column and row levels, along with data masking techniques and proper permission management, we can efficiently protect our information while maintaining the necessary flexibility and accessibility for our users. The key lies in understanding and correctly applying these tools to create a secure and functional environment.


Ref: Databricks Permissions

要查看或添加评论,请登录

Ignacio Alvarez的更多文章

  • Side Project - Staging view: Cheaper is Better

    Side Project - Staging view: Cheaper is Better

    Scheduled Here we are again, trying to scrape every possible argentinian peso. Last week I commented on how, to move…

    2 条评论
  • Side Project - Staging Area??

    Side Project - Staging Area??

    Well, here we are. In my previous post, I discussed how I was ingesting data from a web service that emits public…

    5 条评论
  • Side mini-project: Ingestion from WS

    Side mini-project: Ingestion from WS

    Excited to share progress on a side project involving public transportation data from my city. I recently got access to…

    1 条评论
  • Exploring Data Quality: Insights from 'Data Quality Engineering in Financial Services' Book

    Exploring Data Quality: Insights from 'Data Quality Engineering in Financial Services' Book

    Recently, I've been immersed in the book "Data Quality Engineering in Financial Services" by Brian Buzzelli making my…

    3 条评论
  • One more brick: Delta Sharing

    One more brick: Delta Sharing

    Sharing Data with Delta Sharing When there is a need to share data, either with an end client through visualization…

    3 条评论
  • One more brick: Delta Data Skipping

    One more brick: Delta Data Skipping

    Internally, Databricks provides the "Delta Data Skipping" functionality to enhance performance in reading tables. This…

    3 条评论

社区洞察

其他会员也浏览了