Home / Learn Secure SQL / The Client-Server Model for Databases
The Client-Server Model for Databases
App, driver, network, and database engine as four separate things.
The gistApp, driver, network, and database engine as four separate things.
The idea, explained simply
In plain terms
Your application and your database are almost always two separate programs, often on two separate machines, talking over a connection.
Why we use it
Security controls live at different points in this chain: some in your code, some in the driver, some in the network, some inside the database itself.
Under the hood
Picture four boxes: your app, the driver library, the network connection, and the database server, each with its own job and its own security responsibility.
Real-world use
- Web application code review
- Backend development
- Database administration
| Box | Its job | A security responsibility it has |
|---|---|---|
| Your application | Decides what query to run and with what values | Build the query safely; validate input |
| Driver library | Turns your call into the wire protocol | Correctly separates SQL text from bound values |
| Network connection | Carries bytes between app and server | Use TLS/SSL so data is not readable in transit |
| Database server | Parses, plans, executes, enforces permissions | Grant only the access the app account needs |
Careful:A compromise of any one box can partly undermine the others. That is exactly why this course has a separate part for validation, a separate part for access control, and a separate part for monitoring.
Quick quiz
1. Which box decides what query text to send?
The application builds the query.