π§ Overview of the Process
π Application Program
Written in languages like Java, Python, C#, PHP, etc.
Contains logic for what data to access and what to do with it.
β Database Connectivity Interface (API / Driver)
Acts as a bridge between the application and the DBMS.
Examples:
JDBC (Java Database Connectivity)
ODBC (Open Database Connectivity)
Python DB-API (e.g.,
sqlite3,psycopg2)ORM tools (like Hibernate, SQLAlchemy, Entity Framework)
π Query Execution
Application sends SQL queries (like
SELECT,INSERT,UPDATE,DELETE) through the API.The DBMS interprets, optimizes, and executes the query.
π Results Returned
The DBMS sends back results (data or status messages).
The application processes and displays the results to users.
<div class="infographic-dbarch" id="archWrap">
<style>
.infographic-dbarch {
--ink: #1a1a1a;
--ink-soft: #5c5c5c;
--paper: #ffffff;
--paper-alt: #f6f3ee;
--accent: #2563eb;
--accent-soft:#e3ebfd;
--line: #ddd6c9;
background: var(--paper);
color: var(--ink);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
padding: 2.5rem 1.5rem;
border-radius: 14px;
box-sizing: border-box;
max-width: 640px;
margin: 0 auto;
}
.infographic-dbarch[data-theme="dark"] {
--ink: #e8e6e1;
--ink-soft: #9a968c;
--paper: #121212;
--paper-alt: #1e1e26;
--accent: #5b8def;
--accent-soft:#202942;
--line: #2c313d;
}
.infographic-dbarch * { box-sizing: border-box; }
.arch-eyebrow {
font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
color: var(--accent); font-weight: 700; margin: 0 0 0.4rem; text-align: center;
}
.arch-title { font-size: 1.4rem; font-weight: 700; margin: 0 0 1.75rem; text-align: center; letter-spacing: -0.01em; }
.arch-stage {
position: relative; width: 100%; aspect-ratio: 640 / 440;
}
.arch-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.conn-line {
fill: none; stroke: var(--ink-soft); stroke-width: 3;
stroke-dasharray: 9 7;
animation: archDash 1.1s linear infinite;
transition: stroke .25s;
}
.conn-arrow { fill: var(--ink-soft); transition: fill .25s; }
.conn.is-highlight .conn-line { stroke: var(--accent); }
.conn.is-highlight .conn-arrow { fill: var(--accent); }
.conn.is-dim .conn-line { stroke: var(--line); opacity: 0.55; }
.conn.is-dim .conn-arrow { fill: var(--line); opacity: 0.55; }
@keyframes archDash { to { stroke-dashoffset: -32; } }
@media (prefers-reduced-motion: reduce) {
.conn-line { animation: none; }
}
.arch-node {
position: absolute; font: inherit; cursor: pointer;
display: flex; align-items: center; justify-content: center; text-align: center;
background: var(--paper-alt); border: 2.5px solid var(--ink); color: var(--accent);
font-weight: 800; font-size: 0.95rem; line-height: 1.25; padding: 0.4rem;
transition: border-color .2s, box-shadow .2s, transform .15s;
}
.arch-node:hover { transform: translateY(-1px); }
.arch-node.is-active {
border-color: var(--accent);
box-shadow: 0 0 0 3px var(--accent-soft);
}
.arch-node.node-user { border-radius: 50%; }
.arch-node.node-box { border-radius: 6px; }
.arch-panel {
margin-top: 1.75rem; background: var(--paper-alt); border: 1px solid var(--line);
border-radius: 12px; padding: 1.2rem 1.4rem;
}
.arch-panel.is-fading { animation: archFade .35s ease; }
@keyframes archFade { from { opacity: 0.2; } to { opacity: 1; } }
.arch-panel-title { font-size: 1rem; font-weight: 700; margin: 0 0 0.5rem; color: var(--accent); }
.arch-panel-text { font-size: 0.87rem; line-height: 1.5; margin: 0; }
@media (prefers-reduced-motion: reduce) {
.infographic-dbarch *, .infographic-dbarch *::before, .infographic-dbarch *::after {
transition-duration: 0.001ms !important;
}
}
@media (max-width: 480px) {
.arch-node { font-size: 0.62rem; padding: 0.2rem; }
}
</style>
<p class="arch-eyebrow">System Architecture</p>
<h2 class="arch-title">How Users, Apps, and Databases Connect</h2>
<div class="arch-stage" id="archStage">
<svg class="arch-svg" viewBox="0 0 640 440" preserveAspectRatio="none" id="archSvg"></svg>
</div>
<div class="arch-panel" id="archPanel"></div>
</div>
<script>
(function () {
var wrapper = document.getElementById('archWrap');
// Dark mode detection β body attribute wins, then cookie, then light default
var bodyAttr = document.body.getAttribute('data-darkmode');
var dark;
if (bodyAttr === 'true') {
dark = true;
} else if (bodyAttr === 'false') {
dark = false;
} else {
var match = document.cookie.match(/(?:^|;\s*)darkMode=([^;]+)/);
dark = match ? match[1] === 'true' : false;
}
if (dark) wrapper.setAttribute('data-theme', 'dark');
var VB_W = 640, VB_H = 440;
var nodes = {
user: { label: 'END USER', shape: 'user', x: 340, y: 15, w: 230, h: 85,
detail: 'The person interacting with the system β usually through an application, not the raw database.' },
apps: { label: 'DATABASE APPLICATIONS', shape: 'box', x: 15, y: 175, w: 230, h: 85,
detail: 'Programs and interfaces that let end users work with the data without writing raw queries themselves.' },
dbms: { label: 'DATABASE MANAGEMENT SYSTEM', shape: 'box', x: 330, y: 175, w: 260, h: 85,
detail: 'The software layer that manages storage, retrieval, security, and integrity β the go-between for every request.' },
db: { label: 'DATABASE', shape: 'box', x: 330, y: 330, w: 260, h: 85,
detail: 'The actual data, physically stored and organized on disk.' }
};
var connections = [
{ a: 'user', b: 'apps', x1: 400, y1: 100, x2: 235, y2: 175 },
{ a: 'user', b: 'dbms', x1: 452, y1: 100, x2: 458, y2: 175 },
{ a: 'apps', b: 'dbms', x1: 245, y1: 217, x2: 330, y2: 217 },
{ a: 'dbms', b: 'db', x1: 460, y1: 260, x2: 460, y2: 330 }
];
function pct(v, total) { return (v / total * 100).toFixed(2) + '%'; }
function arrowPoints(tipX, tipY, dirX, dirY, size) {
var baseX = tipX - dirX * size;
var baseY = tipY - dirY * size;
var perpX = -dirY, perpY = dirX;
var lx = baseX + perpX * size * 0.55, ly = baseY + perpY * size * 0.55;
var rx = baseX - perpX * size * 0.55, ry = baseY - perpY * size * 0.55;
return tipX + ',' + tipY + ' ' + lx.toFixed(1) + ',' + ly.toFixed(1) + ' ' + rx.toFixed(1) + ',' + ry.toFixed(1);
}
var svg = document.getElementById('archSvg');
var connGroups = {};
connections.forEach(function (c) {
var dx = c.x2 - c.x1, dy = c.y2 - c.y1;
var len = Math.sqrt(dx * dx + dy * dy);
var ux = dx / len, uy = dy / len;
var size = 11;
var g = document.createElementNS('http://www.w3.org/2000/svg', 'g');
g.setAttribute('class', 'conn');
g.dataset.a = c.a;
g.dataset.b = c.b;
var path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
path.setAttribute('class', 'conn-line');
path.setAttribute('d', 'M ' + c.x1 + ' ' + c.y1 + ' L ' + c.x2 + ' ' + c.y2);
g.appendChild(path);
var arrowEnd = document.createElementNS('http://www.w3.org/2000/svg', 'polygon');
arrowEnd.setAttribute('class', 'conn-arrow');
arrowEnd.setAttribute('points', arrowPoints(c.x2, c.y2, ux, uy, size));
g.appendChild(arrowEnd);
var arrowStart = document.createElementNS('http://www.w3.org/2000/svg', 'polygon');
arrowStart.setAttribute('class', 'conn-arrow');
arrowStart.setAttribute('points', arrowPoints(c.x1, c.y1, -ux, -uy, size));
g.appendChild(arrowStart);
svg.appendChild(g);
connGroups[c.a + '-' + c.b] = g;
});
var stage = document.getElementById('archStage');
var panel = document.getElementById('archPanel');
var nodeButtons = {};
Object.keys(nodes).forEach(function (key) {
var n = nodes[key];
var btn = document.createElement('button');
btn.type = 'button';
btn.className = 'arch-node ' + (n.shape === 'user' ? 'node-user' : 'node-box');
btn.style.left = pct(n.x, VB_W);
btn.style.top = pct(n.y, VB_H);
btn.style.width = pct(n.w, VB_W);
btn.style.height = pct(n.h, VB_H);
btn.textContent = n.label;
btn.addEventListener('click', function () { selectNode(key); });
stage.appendChild(btn);
nodeButtons[key] = btn;
});
function selectNode(key) {
Object.keys(nodeButtons).forEach(function (k) {
nodeButtons[k].classList.toggle('is-active', k === key);
});
Object.keys(connGroups).forEach(function (ck) {
var g = connGroups[ck];
var touches = g.dataset.a === key || g.dataset.b === key;
g.classList.toggle('is-highlight', touches);
g.classList.toggle('is-dim', !touches);
});
var n = nodes[key];
panel.innerHTML = '<h3 class="arch-panel-title">' + n.label + '</h3><p class="arch-panel-text">' + n.detail + '</p>';
panel.classList.remove('is-fading');
void panel.offsetWidth;
panel.classList.add('is-fading');
}
selectNode('dbms');
})();
</script>.demo {
font-family: system-ui, sans-serif;
padding: 16px;
}
.demo h1 {
color: #2563eb;
margin: 0 0 8px;
}
.demo p {
color: #4b5563;
margin: 0;
}document.querySelector('.demo h1')?.addEventListener('click', () => {
alert('Hello from live preview!');
});β Benefits of Accessing Databases via Applications:
Dynamic user interaction (forms, dashboards)
Real-time data updates
Secure data operations with user authentication
Separation of logic and data (maintainable architecture)