Skip to content

Commit c5199bf

Browse files
authored
Merge pull request #38 from mnaimfaizy/feature/database-module
feat(database): Add Database & DBMS interactive learning module
2 parents 9779264 + f513655 commit c5199bf

30 files changed

+8571
-9
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,21 @@ Comprehensive backend architecture module with 6+ interactive visualizations cov
395395
- **Observability**: Three pillars (Logs, Metrics, Traces) with interactive triangle diagram, tool recommendations, and incident response workflow
396396
- **Request Lifecycle**: Animated "Buy Now" journey through DNS → TCP/TLS → Load Balancer → API Gateway → Cache → Database → Message Queue → Response with latency budgets
397397

398+
### 🗄️ **Database & DBMS (Complete)**
399+
400+
Comprehensive database internals module with 7 interactive visualizations covering relational and NoSQL database architecture:
401+
402+
- **Introduction**: Data vs Database vs DBMS, learning journey overview, stats grid, and module navigation
403+
- **Database Models**: Interactive comparison of 5 paradigms (Relational, Document, Key-Value, Graph, Vector) with Database Taxonomy visualization
404+
- **DBMS Architecture**: Query Processor + Storage Engine pillars, Oracle vs PostgreSQL background processes comparison
405+
- **Query Processor**: Parser → Rewriter → Cost-Based Optimizer → Execution Engine pipeline with animated SQL lifecycle visualization
406+
- **Storage Engine**: Buffer Manager, Access Methods (B-Tree, Hash), Lock Manager, Recovery Manager with interactive buffer cache simulation
407+
- **SQL Fundamentals**: Interactive CRUD examples with category tabs, Window Functions, SQL vs NoSQL comparison
408+
- **Indexing & Optimization**: Interactive B-Tree insertion/search visualization, B-Tree vs Hash index comparison, query optimizer GPS analogy
409+
- **Transactions & ACID**: Atomicity, Consistency, Isolation, Durability with concurrent transaction demo (success & crash scenarios)
410+
- **Oracle vs PostgreSQL**: SGA vs shared_buffers, process models, MVCC Undo/Redo vs dead tuples, commit flow comparison with interactive MVCC visualization
411+
- **Visualization Hub**: 7 interactive visualizations — Database Taxonomy, Query Lifecycle, B-Tree Index, Buffer Manager, ACID Transactions, MVCC Comparison, ER Diagram Builder
412+
398413
- **Multi-Language Execution**: JavaScript, TypeScript (transpiled), and Python (Pyodide WASM) — all in-browser, no server
399414
- **AST Instrumentation**: Acorn/Astring pipeline injects `__snapshot()` calls around every statement; Python uses `sys.settrace` wrapper with base64-encoded source
400415
- **Timeline Player**: Step forward/backward through execution snapshots, inspect variables and call stack at each point
@@ -480,7 +495,7 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
480495
- 📧 **Issues**: Report bugs or request features via GitHub Issues
481496
- 💬 **Discussions**: Join community discussions for questions and ideas
482497
- 📖 **Documentation**: Comprehensive docs available in the `/docs` directory
483-
- 🎓 **Learning Modules**: 15 complete interactive modules with 96+ visualizations
498+
- 🎓 **Learning Modules**: 16 complete interactive modules with 103+ visualizations
484499
- 🎯 **Playground**: LeetCode-style coding environment with debugging and gamification
485500

486501
---

docs/Database and DBMS Explained for All.md

Lines changed: 411 additions & 0 deletions
Large diffs are not rendered by default.

src/App.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const NodeJSPage = lazy(() => import('./features/nodejs'));
3232
const AuthPage = lazy(() => import('./features/auth'));
3333
const DevOpsPage = lazy(() => import('./features/devops'));
3434
const BackendPage = lazy(() => import('./features/backend'));
35+
const DatabasePage = lazy(() => import('./features/database'));
3536

3637
// Standalone pages (rendered without main app layout)
3738
const PlaygroundEntry = lazy(() => import('./features/playground/PlaygroundEntry'));
@@ -220,6 +221,14 @@ const App: React.FC = () => {
220221
</SuspenseRoute>
221222
}
222223
/>
224+
<Route
225+
path="/database"
226+
element={
227+
<SuspenseRoute>
228+
<DatabasePage />
229+
</SuspenseRoute>
230+
}
231+
/>
223232
</Routes>
224233
</main>
225234
</div>

src/components/Header.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
Cloud,
2020
Shield,
2121
Rocket,
22+
HardDrive,
2223
} from 'lucide-react';
2324
import { useUI } from '../shared/contexts';
2425

@@ -144,6 +145,12 @@ const Header: React.FC = () => {
144145
icon: <Server className="w-4 h-4" />,
145146
description: 'Backend patterns & API design',
146147
},
148+
{
149+
label: 'Database & DBMS',
150+
path: '/database',
151+
icon: <HardDrive className="w-4 h-4" />,
152+
description: 'Database internals & optimization',
153+
},
147154
],
148155
},
149156
];

src/components/Sidebar.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ const getThemeColorClass = (
9191
buttonHover: 'hover:text-slate-600',
9292
border: 'border-slate-100',
9393
},
94+
teal: {
95+
active: 'bg-teal-100 text-teal-800 border-teal-500',
96+
hover: 'hover:bg-teal-50 hover:text-teal-700',
97+
buttonActive: 'text-teal-600 hover:text-teal-700',
98+
buttonHover: 'hover:text-teal-600',
99+
border: 'border-teal-100',
100+
},
94101
};
95102

96103
const colors = colorMap[theme.primary] || colorMap.blue;
@@ -401,6 +408,30 @@ const sidebarSections: Record<string, Array<SidebarItem>> = {
401408
{ label: 'Request Lifecycle', path: '/backend?section=Request%20Lifecycle' },
402409
{ label: 'Visualization', path: '/backend?section=Visualization' },
403410
],
411+
'/database': [
412+
{ label: 'Introduction', path: '/database?section=Introduction' },
413+
{ label: 'Database Models', path: '/database?section=Database%20Models' },
414+
{
415+
label: 'DBMS Architecture',
416+
path: '/database?section=DBMS%20Architecture',
417+
subItems: [
418+
{ label: 'Query Processor', path: '/database?section=Query%20Processor' },
419+
{ label: 'Storage Engine', path: '/database?section=Storage%20Engine' },
420+
],
421+
},
422+
{ label: 'SQL Fundamentals', path: '/database?section=SQL%20Fundamentals' },
423+
{
424+
label: 'Indexing & Optimization',
425+
path: '/database?section=Indexing%20%26%20Optimization',
426+
},
427+
{ label: 'Transactions & ACID', path: '/database?section=Transactions%20%26%20ACID' },
428+
{ label: 'Oracle vs PostgreSQL', path: '/database?section=Oracle%20vs%20PostgreSQL' },
429+
{
430+
label: 'SQL vs NoSQL vs Vector',
431+
path: '/database?section=SQL%20vs%20NoSQL%20vs%20Vector',
432+
},
433+
{ label: 'Visualization', path: '/database?section=Visualization' },
434+
],
404435
'/': [],
405436
'/about': [],
406437
};
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
import React, { Suspense } from 'react';
2+
import { useLocation } from 'react-router-dom';
3+
import { ErrorBoundary } from '../../shared/components/feedback/ErrorBoundary';
4+
import { LoadingFallback } from '../../shared/components/feedback/LoadingFallback';
5+
import { SEO } from '../../shared/components/SEO/SEO';
6+
import ModuleQuizSection from '../../shared/components/quiz/ModuleQuizSection';
7+
8+
// Lazy load section components for better performance
9+
import Introduction from './components/sections/Introduction';
10+
const DatabaseModels = React.lazy(() => import('./components/sections/DatabaseModels'));
11+
const DBMSArchitecture = React.lazy(() => import('./components/sections/DBMSArchitecture'));
12+
const QueryProcessor = React.lazy(() => import('./components/sections/QueryProcessor'));
13+
const StorageEngine = React.lazy(() => import('./components/sections/StorageEngine'));
14+
const SQLFundamentals = React.lazy(() => import('./components/sections/SQLFundamentals'));
15+
const IndexingOptimization = React.lazy(() => import('./components/sections/IndexingOptimization'));
16+
const TransactionsACID = React.lazy(() => import('./components/sections/TransactionsACID'));
17+
const OracleVsPostgreSQL = React.lazy(() => import('./components/sections/OracleVsPostgreSQL'));
18+
const SQLvsNoSQLvsVector = React.lazy(() => import('./components/sections/SQLvsNoSQLvsVector'));
19+
const Visualization = React.lazy(() => import('./components/sections/Visualization'));
20+
const Quiz = () => <ModuleQuizSection moduleId="database" />;
21+
22+
const sectionComponents: Record<string, React.ComponentType> = {
23+
Introduction,
24+
'Database Models': DatabaseModels,
25+
'DBMS Architecture': DBMSArchitecture,
26+
'Query Processor': QueryProcessor,
27+
'Storage Engine': StorageEngine,
28+
'SQL Fundamentals': SQLFundamentals,
29+
'Indexing & Optimization': IndexingOptimization,
30+
'Transactions & ACID': TransactionsACID,
31+
'Oracle vs PostgreSQL': OracleVsPostgreSQL,
32+
'SQL vs NoSQL vs Vector': SQLvsNoSQLvsVector,
33+
Visualization,
34+
Quiz,
35+
};
36+
37+
function useQuery(): URLSearchParams {
38+
return new URLSearchParams(useLocation().search);
39+
}
40+
41+
const DatabasePage: React.FC = () => {
42+
const query = useQuery();
43+
const section = query.get('section') || 'Introduction';
44+
const Component = sectionComponents[section] || Introduction;
45+
46+
return (
47+
<>
48+
<SEO
49+
title="Database & DBMS - Code Executives"
50+
description="Master database internals, DBMS architecture, SQL optimization, B-Tree indexing, ACID transactions, and the comparative engines of Oracle vs PostgreSQL through interactive visualizations."
51+
keywords={[
52+
'database',
53+
'DBMS',
54+
'SQL',
55+
'NoSQL',
56+
'B-Tree',
57+
'indexing',
58+
'ACID',
59+
'transactions',
60+
'MVCC',
61+
'PostgreSQL',
62+
'Oracle',
63+
'query optimization',
64+
]}
65+
canonicalUrl="https://code-executives.com/database"
66+
/>
67+
<div className="p-4 sm:p-6">
68+
<ErrorBoundary level="feature">
69+
<Suspense fallback={<LoadingFallback variant="skeleton-page" />}>
70+
<Component />
71+
</Suspense>
72+
</ErrorBoundary>
73+
</div>
74+
</>
75+
);
76+
};
77+
78+
export default DatabasePage;

0 commit comments

Comments
 (0)