1.4 Duality-View Security: Simple, Centralized, Use-Case-Specific
Duality views give you better data security. You can control access and operations at any level.
Security control is centralized. Like everything else about duality views, it is defined, verified, enforced, and audited in the database. This contrasts strongly with trying to secure your data in each application. You control access to the documents supported by a duality-view the same way you control access to other database objects: using privileges, grants, and roles.
Duality-view security is use-case-specific. Instead of according broad visibility at the table level, a duality view exposes only relevant columns of data from its underlying tables. For example, an application that has access to a teacher view, which contains some student data, won't have access to private student data, such as social-security number or address.
Beyond exposure/visibility, a duality view can declaratively define which data can be updated, in which ways. A student view could allow a student name to be changed, while a teacher view would not allow that. A teacher-facing application could be able to change a course name, but a student-facing application would not. See Updatable JSON-Relational Duality Views and Updating Documents/Data in Duality Views.
You can combine the two kinds of security control, to control who/what can do what to which fields:
-
Create similar duality views that expose slightly different sets of columns as document fields. That is, define views intended for different groups of actors. (The documents supported by a duality view are not stored as such, so this has no extra cost.)
-
Grant privileges and roles, to selectively let different groups of users/apps access different views.
Contrast this declarative, in-database, field-level access control with having to somehow — with application code or using an object-relational mapper (ORM) — prevent a user or application from being able to access and update all data in a given table or set of documents.
The database automatically detects document changes, and updates only the relevant table rows. And conversely, table updates are automatically reflected in the documents they underlie. There's no mapping layer outside the database, no ORM intermediary to call upon to remap anything.
And client applications can use JSON documents directly. There's no need for a mapper to connect application objects and classes to documents and document types.
Multiple applications can also update documents or their underlying tables concurrently. Changes to either are transparently and immediately reflected in the other. In particular, existing SQL tools can update table rows at the same time applications update documents based on those rows. Document-level consistency, and table row-level consistency, are guaranteed together.
And this secure concurrency can be lock-free, and thus highly performant. See Using Optimistic Concurrency Control With Duality Views.
Particular Oracle Database security features that you can use JSON-relational duality views with include Transparent Data Encryption (TDE), Data Redaction, and Virtual Private Database.
Related Topics
Parent topic: Overview of JSON-Relational Duality Views