Three Main Types of Actions Involve Databases

Published
Length
3 min read

Luis Felipe Dias

All posts

The three main types of actions involve databases: reading records, writing data, and changing structure. You control these actions by setting up separate roles for each task. Most engineering teams start by giving developers one shared login for the database. This wide role lets anyone read, write, or drop tables during a debug session. Broad roles create high risk when a developer runs a bad query in production. How the three main types of actions involve databases in daily work Database en

DPoP (Demonstration of Proof-of-Possession) + GitHub Actions Security: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

The three main types of actions involve databases: reading records, writing data, and changing structure. You control these actions by setting up separate roles for each task. Most engineering teams start by giving developers one shared login for the database. This wide role lets anyone read, write, or drop tables during a debug session. Broad roles create high risk when a developer runs a bad query in production.

How the three main types of actions involve databases in daily work

Database engines group every command into three basic buckets. The first type is data reading, where users or apps pull records to view. Teams use read actions to check state, build reports, and find bugs. Even a simple read query can expose user emails, phone numbers, or card numbers.

The second type is data writing, which adds, updates, or deletes rows inside tables. Apps run write actions all day to save user orders and update account state. Engineers also run manual write commands to fix broken records during live incidents. One bad write query without a filter can overwrite thousands of customer rows.

The third type is schema and control work, which changes how the database runs. These actions create tables, add indexes, change user roles, and drop old columns. Teams usually run schema changes through automated deploy tools rather than manual sessions. Mixing schema rights with daily read and write roles leads to accidental table drops.

How to set up native database roles for each action type

You can separate these three action types using native database role rules. Start by creating a read-only role that only selects data from safe tables. Assign this base role to engineers for their daily check and debug work. Next, create a write role that allows row updates on specific app tables. Keep schema change rights inside an admin role used only by deploy pipelines.

Database admins map these local roles to group accounts in your identity system. When an engineer logs in, the database checks their group and sets their role. This native setup stops a standard read user from dropping a production table. It also keeps app accounts from changing database rules if an attacker steals a key.

DPoP (Demonstration of Proof-of-Possession) + GitHub Actions Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Where static database roles fall short in production

Native database roles only check who logs in at the start of a session. Once the session starts, the database trusts every command that fits that role. A user with read rights can still pull millions of rows at once. Native roles do not rewrite sensitive fields like national IDs or card numbers in results.

Static roles also struggle when an engineer needs quick write rights to fix a bug. Admins end up granting permanent write roles because revoking them by hand takes too long. The database log often shows a shared role name instead of the real person. Teams need a way to check individual queries in flight and mask private fields.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

What are the three core action types in a database?

The three types are reading data, writing records, and changing the database structure. SQL systems split these into query statements, data change statements, and schema rules.

Why should teams split read and write roles for engineers?

Splitting read and write roles stops accidental updates or deletes during routine bug checks. Engineers can inspect live state with a read role and only request write rights when needed.

Do read-only database roles protect private customer data?

No, a native read-only role still returns raw emails, phone numbers, and card numbers. To protect private fields during read queries, you must apply data masking to the results.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.