Repository navigation
Expand file tree
/
Copy pathtutorial.html
More file actions
1336 lines (1205 loc) · 50.4 KB
/
Copy pathtutorial.html
File metadata and controls
1336 lines (1205 loc) · 50.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en" class="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FaizDB Interactive Tutorial & Real-World Use Cases</title>
<meta name="description" content="Step-by-step interactive tutorial for FaizDB — multi-dialect SQL & MongoDB queries, ACID MVCC ticketing, HNSW AI vector search, GraphRAG, and 128Hz robotics edge streaming.">
<!-- Google Fonts: Plus Jakarta Sans & JetBrains Mono -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap" rel="stylesheet">
<style>
:root {
--bg: #FAFAFC;
--surface: #FFFFFF;
--surface-subtle: #F1F5F9;
--border: #E2E8F0;
--text: #0F172A;
--text-muted: #64748B;
--primary: #4F46E5;
--primary-hover: #4338CA;
--primary-light: #EEF2FF;
--accent-emerald: #10B981;
--accent-amber: #F59E0B;
--accent-cyan: #06B6D4;
--accent-purple: #8B5CF6;
--code-bg: #0F172A;
--code-text: #F8FAFC;
--card-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
--card-hover: 0 10px 30px rgba(0, 0, 0, 0.08);
--radius: 16px;
}
html.dark {
--bg: #090D16;
--surface: #0F172A;
--surface-subtle: #1E293B;
--border: #1E293B;
--text: #F8FAFC;
--text-muted: #94A3B8;
--primary: #6366F1;
--primary-hover: #4F46E5;
--primary-light: #1E1B4B;
--code-bg: #030712;
--code-text: #F1F5F9;
--card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
--card-hover: 0 10px 30px rgba(0, 0, 0, 0.5);
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: 'Plus Jakarta Sans', sans-serif;
}
body {
background-color: var(--bg);
color: var(--text);
line-height: 1.6;
transition: background-color 0.2s, color 0.2s;
}
/* Top Navigation */
nav {
position: sticky;
top: 0;
z-index: 100;
background: rgba(255, 255, 255, 0.85);
backdrop-filter: blur(12px);
border-bottom: 1px solid var(--border);
height: 4.25rem;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 2rem;
}
html.dark nav {
background: rgba(15, 23, 42, 0.85);
}
.nav-brand {
display: flex;
align-items: center;
gap: 0.75rem;
text-decoration: none;
color: var(--text);
font-weight: 800;
font-size: 1.2rem;
}
.brand-logo {
width: 36px;
height: 36px;
background: linear-gradient(135deg, #F59E0B, #EA580C);
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.25rem;
box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
.badge-tutorial {
background: var(--primary-light);
color: var(--primary);
font-size: 0.75rem;
font-weight: 700;
padding: 0.2rem 0.6rem;
border-radius: 9999px;
border: 1px solid rgba(99, 102, 241, 0.2);
text-transform: uppercase;
letter-spacing: 0.05em;
}
.nav-actions {
display: flex;
align-items: center;
gap: 1rem;
}
.progress-pill {
display: flex;
align-items: center;
gap: 0.5rem;
background: var(--surface-subtle);
border: 1px solid var(--border);
padding: 0.35rem 0.85rem;
border-radius: 9999px;
font-size: 0.8rem;
font-weight: 600;
color: var(--text-muted);
}
.progress-pill span.num {
color: var(--accent-emerald);
font-weight: 800;
}
.btn-action {
background: transparent;
border: 1px solid var(--border);
color: var(--text);
padding: 0.45rem 0.85rem;
border-radius: 10px;
font-size: 0.85rem;
font-weight: 600;
cursor: pointer;
text-decoration: none;
display: inline-flex;
align-items: center;
gap: 0.4rem;
transition: all 0.15s;
}
.btn-action:hover {
background: var(--surface-subtle);
border-color: var(--text-muted);
}
.btn-primary-action {
background: var(--primary);
color: white;
border: 1px solid var(--primary);
}
.btn-primary-action:hover {
background: var(--primary-hover);
color: white;
}
/* Layout */
.layout-wrapper {
max-width: 1380px;
margin: 0 auto;
display: flex;
gap: 2.5rem;
padding: 2.5rem 1.5rem;
}
/* Sticky Sidebar Stepper */
aside.stepper-nav {
width: 300px;
position: sticky;
top: 5.5rem;
height: calc(100vh - 6.5rem);
overflow-y: auto;
flex-shrink: 0;
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.stepper-header {
font-size: 0.75rem;
font-weight: 800;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--text-muted);
padding: 0.5rem 0.75rem;
}
.stepper-item {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.65rem 0.85rem;
border-radius: 12px;
text-decoration: none;
color: var(--text-muted);
font-size: 0.875rem;
font-weight: 500;
transition: all 0.15s;
border: 1px solid transparent;
}
.stepper-item:hover {
background: var(--surface-subtle);
color: var(--text);
}
.stepper-item.active {
background: var(--surface);
color: var(--primary);
font-weight: 700;
border-color: var(--border);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.step-badge {
width: 26px;
height: 26px;
border-radius: 50%;
background: var(--surface-subtle);
border: 1px solid var(--border);
display: flex;
align-items: center;
justify-content: center;
font-size: 0.75rem;
font-weight: 700;
flex-shrink: 0;
transition: all 0.15s;
}
.stepper-item.active .step-badge {
background: var(--primary);
color: white;
border-color: var(--primary);
}
.step-badge.completed {
background: var(--accent-emerald);
color: white;
border-color: var(--accent-emerald);
}
/* Main Tutorial Content */
main.tutorial-content {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 3rem;
}
/* Hero Header */
.tutorial-hero {
background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(16, 185, 129, 0.08));
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 2.5rem;
position: relative;
overflow: hidden;
}
.hero-tag {
display: inline-flex;
align-items: center;
gap: 0.4rem;
background: rgba(16, 185, 129, 0.15);
color: var(--accent-emerald);
font-size: 0.8rem;
font-weight: 700;
padding: 0.25rem 0.75rem;
border-radius: 9999px;
margin-bottom: 1rem;
}
.tutorial-hero h1 {
font-size: 2.5rem;
font-weight: 800;
letter-spacing: -0.03em;
line-height: 1.2;
margin-bottom: 1rem;
}
.tutorial-hero p.lead {
font-size: 1.1rem;
color: var(--text-muted);
max-width: 850px;
line-height: 1.7;
}
/* Module Card */
.module-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 2.25rem;
box-shadow: var(--card-shadow);
display: flex;
flex-direction: column;
gap: 1.5rem;
scroll-margin-top: 6rem;
}
.module-header {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 1rem;
border-bottom: 1px solid var(--border);
padding-bottom: 1.25rem;
}
.module-title-area {
display: flex;
align-items: center;
gap: 0.75rem;
}
.module-icon {
width: 42px;
height: 42px;
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.35rem;
background: var(--surface-subtle);
border: 1px solid var(--border);
}
.module-title {
font-size: 1.4rem;
font-weight: 800;
letter-spacing: -0.02em;
}
.module-sub {
font-size: 0.85rem;
color: var(--text-muted);
}
/* Use Case Scenario Box */
.scenario-box {
background: rgba(99, 102, 241, 0.05);
border-left: 4px solid var(--primary);
padding: 1rem 1.25rem;
border-radius: 0 12px 12px 0;
font-size: 0.92rem;
color: var(--text);
}
.scenario-box strong {
color: var(--primary);
}
/* Code Container & Tabs */
.code-container {
background: var(--code-bg);
border: 1px solid #1E293B;
border-radius: 14px;
overflow: hidden;
margin-top: 0.5rem;
}
.code-topbar {
display: flex;
align-items: center;
justify-content: space-between;
background: rgba(15, 23, 42, 0.6);
border-bottom: 1px solid #1E293B;
padding: 0.5rem 1rem;
}
.code-tabs {
display: flex;
gap: 0.25rem;
}
.code-tab {
background: transparent;
border: none;
color: #94A3B8;
font-size: 0.75rem;
font-weight: 600;
padding: 0.35rem 0.75rem;
border-radius: 6px;
cursor: pointer;
transition: all 0.15s;
}
.code-tab.active {
background: #334155;
color: #F8FAFC;
}
.btn-copy {
background: #1E293B;
border: 1px solid #334155;
color: #94A3B8;
font-size: 0.75rem;
font-weight: 600;
padding: 0.3rem 0.65rem;
border-radius: 6px;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 0.3rem;
transition: all 0.15s;
}
.btn-copy:hover {
background: #334155;
color: white;
}
pre code {
display: block;
padding: 1.25rem;
font-family: 'JetBrains Mono', monospace;
font-size: 0.85rem;
line-height: 1.6;
color: var(--code-text);
overflow-x: auto;
}
/* Live Interactive Sandbox Box */
.sandbox-box {
background: var(--surface-subtle);
border: 1px solid var(--border);
border-radius: 12px;
padding: 1.25rem;
display: flex;
flex-direction: column;
gap: 1rem;
}
.sandbox-header {
display: flex;
align-items: center;
justify-content: space-between;
}
.sandbox-title {
font-size: 0.85rem;
font-weight: 700;
display: flex;
align-items: center;
gap: 0.4rem;
color: var(--text);
}
.btn-run {
background: var(--accent-emerald);
color: white;
border: none;
padding: 0.45rem 1rem;
border-radius: 8px;
font-size: 0.85rem;
font-weight: 700;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 0.4rem;
transition: all 0.15s;
box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.btn-run:hover {
opacity: 0.9;
transform: translateY(-1px);
}
.sandbox-output {
background: var(--code-bg);
border: 1px solid #1E293B;
border-radius: 8px;
padding: 1rem;
font-family: 'JetBrains Mono', monospace;
font-size: 0.8rem;
color: #10B981;
min-height: 70px;
white-space: pre-wrap;
overflow-x: auto;
}
.btn-complete {
align-self: flex-start;
background: transparent;
border: 1px solid var(--border);
color: var(--text);
padding: 0.5rem 1rem;
border-radius: 8px;
font-size: 0.85rem;
font-weight: 600;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 0.5rem;
transition: all 0.15s;
}
.btn-complete.done {
background: rgba(16, 185, 129, 0.1);
border-color: var(--accent-emerald);
color: var(--accent-emerald);
}
/* Responsive */
@media (max-width: 1024px) {
.layout-wrapper {
flex-direction: column;
}
aside.stepper-nav {
width: 100%;
height: auto;
position: static;
}
}
</style>
</head>
<body>
<!-- Top Navigation -->
<nav>
<a href="index.html" class="nav-brand">
<div class="brand-logo">🔥</div>
<span>FaizDB</span>
<span class="badge-tutorial">Interactive Tutorial</span>
</a>
<div class="nav-actions">
<div class="progress-pill">
<span>Progress:</span>
<span class="num" id="progress-text">0 of 9 Completed</span>
</div>
<a href="http://localhost:27020" target="_blank" class="btn-action btn-primary-action">
🖥️ Open Web Studio
</a>
<a href="https://github.com/ictdothouse/faizdb" target="_blank" class="btn-action">
⭐ GitHub
</a>
<button id="theme-toggle" class="btn-action" onclick="toggleTheme()">
🌙 Mode
</button>
</div>
</nav>
<!-- Layout Wrapper -->
<div class="layout-wrapper">
<!-- Left Stepper Navigation -->
<aside class="stepper-nav">
<div class="stepper-header">Tutorial Modules</div>
<a href="#module-1" class="stepper-item active" id="step-nav-1">
<span class="step-badge" id="badge-1">1</span>
<span>60-Second Onboarding</span>
</a>
<a href="#module-2" class="stepper-item" id="step-nav-2">
<span class="step-badge" id="badge-2">2</span>
<span>Multi-Dialect Duality</span>
</a>
<a href="#module-3" class="stepper-item" id="step-nav-3">
<span class="step-badge" id="badge-3">3</span>
<span>E-Commerce (Zero Oversell)</span>
</a>
<a href="#module-4" class="stepper-item" id="step-nav-4">
<span class="step-badge" id="badge-4">4</span>
<span>AI Vector Semantic Search</span>
</a>
<a href="#module-5" class="stepper-item" id="step-nav-5">
<span class="step-badge" id="badge-5">5</span>
<span>GraphRAG Knowledge Graph</span>
</a>
<a href="#module-6" class="stepper-item" id="step-nav-6">
<span class="step-badge" id="badge-6">6</span>
<span>Robotics & Edge IoT Streaming</span>
</a>
<a href="#module-7" class="stepper-item" id="step-nav-7">
<span class="step-badge" id="badge-7">7</span>
<span>EXPLAIN ANALYZE Diagnostics</span>
</a>
<a href="#module-8" class="stepper-item" id="step-nav-8">
<span class="step-badge" id="badge-8">8</span>
<span>MySQL Wire & Laravel CMS</span>
</a>
<a href="#module-9" class="stepper-item" id="step-nav-9">
<span class="step-badge" id="badge-9">9</span>
<span>Production Hardening & Durability</span>
</a>
</aside>
<!-- Main Content Area -->
<main class="tutorial-content">
<!-- Hero Banner -->
<section class="tutorial-hero">
<div class="hero-tag">🎓 Hands-on Developer Guide</div>
<h1>Master FaizDB in 15 Minutes</h1>
<p class="lead">
Welcome to the official interactive tutorial for FaizDB. Explore how a single 8MB native binary delivers 5-way wire protocols (MySQL, PostgreSQL, MongoDB, gRPC, REST), multi-dialect SQL & MongoDB syntax, sub-millisecond AI vector search, GraphRAG multi-hop traversal, and 128Hz robotics telemetry with zero GC pauses.
</p>
</section>
<!-- MODULE 1: Quick Launch -->
<section class="module-card" id="module-1">
<div class="module-header">
<div class="module-title-area">
<div class="module-icon">⚡</div>
<div>
<h2 class="module-title">Module 1: 60-Second First Launch & 5-Way Universal Gateway</h2>
<p class="module-sub">Start the 5-way multi-protocol server or interactive REPL shell in under a minute.</p>
</div>
</div>
</div>
<div class="scenario-box">
<strong>Scenario:</strong> You need a self-contained, portable database for development that requires zero system configuration, zero background daemons, and doesn't pollute the Windows registry.
</div>
<div class="code-container">
<div class="code-topbar">
<div class="code-tabs">
<button class="code-tab active" onclick="switchTab(this, 'c1-win')">Windows (1-Click)</button>
<button class="code-tab" onclick="switchTab(this, 'c1-cli')">PowerShell / Terminal</button>
<button class="code-tab" onclick="switchTab(this, 'c1-unix')">Linux & macOS</button>
</div>
<button class="btn-copy" onclick="copyCode(this)">Copy</button>
</div>
<pre id="c1-win"><code># 1. Double click the official 1-click launcher inside your extracted folder:
start-faizdb-studio.bat
# It starts the 5-Way Gateway and immediately opens Studio at:
# http://localhost:27020</code></pre>
<pre id="c1-cli" style="display:none;"><code># Start interactive shell directly:
.\faizdb.exe shell
# Or start 5-Way server (using port 5433 to avoid local PostgreSQL conflicts):
.\faizdb.exe serve --pg-port 5433 --mysql-port 3306</code></pre>
<pre id="c1-unix" style="display:none;"><code># 1-Line Universal Install & Run:
curl -fsSL https://raw.githubusercontent.com/ictdothouse/faizdb/main/scripts/install.sh | bash
./faizdb serve --pg-port 5433 --mysql-port 3306</code></pre>
</div>
<!-- Live Sandbox -->
<div class="sandbox-box">
<div class="sandbox-header">
<span class="sandbox-title">🧪 Live Health Check Simulator</span>
<button class="btn-run" onclick="runSandbox(1)">▶ Ping Engine Health (/v1/health)</button>
</div>
<div class="sandbox-output" id="output-1">Click "Ping Engine Health" to simulate connecting to the 5-Way Gateway...</div>
</div>
<button class="btn-complete" id="chk-1" onclick="toggleComplete(1)">
✓ Mark Module 1 as Completed
</button>
</section>
<!-- MODULE 2: Multi-Dialect Duality -->
<section class="module-card" id="module-2">
<div class="module-header">
<div class="module-title-area">
<div class="module-icon">🍃</div>
<div>
<h2 class="module-title">Module 2: Multi-Dialect Duality (Insert Mongo -> Query SQL)</h2>
<p class="module-sub">Store documents with MongoDB syntax and query them instantly with Relational SQL.</p>
</div>
</div>
</div>
<div class="scenario-box">
<strong>Scenario:</strong> Frontend developers love working with flexible JSON documents (MongoDB style), while data analysts and backend reporting teams need standard SQL queries. FaizDB unifies both without ETL pipelines!
</div>
<div class="code-container">
<div class="code-topbar">
<div class="code-tabs">
<button class="code-tab active" onclick="switchTab(this, 'c2-mongo')">1. MongoDB Insert</button>
<button class="code-tab" onclick="switchTab(this, 'c2-sql')">2. SQL Query</button>
<button class="code-tab" onclick="switchTab(this, 'c2-advanced')">3. Range, IN & Analytics</button>
<button class="code-tab" onclick="switchTab(this, 'c2-python')">Python (PyMongo)</button>
</div>
<button class="btn-copy" onclick="copyCode(this)">Copy</button>
</div>
<pre id="c2-mongo"><code>// Inside faizdb shell or MongoDB Compass (Port 27017):
db.inventory.insert({
"sku": "GPU-5090",
"name": "NVIDIA RTX 5090",
"category": "Hardware",
"price": 1999.00,
"stock": 42
});</code></pre>
<pre id="c2-sql" style="display:none;"><code>-- Query the EXACT SAME collection using relational SQL:
SELECT name, price, stock
FROM inventory
WHERE category = 'Hardware' AND price > 1000
ORDER BY price DESC;</code></pre>
<pre id="c2-advanced" style="display:none;"><code>-- Advanced range, membership, and boolean filtering:
SELECT name, price, stock
FROM inventory
WHERE price BETWEEN 1000 AND 2500
AND category IN ('Hardware', 'Electronics')
AND (stock > 10 OR sku = 'GPU-5090');
-- High-speed vectorized columnar batch aggregations:
SELECT COUNT(*), AVG(price), MIN(price), MAX(price)
FROM inventory;</code></pre>
<pre id="c2-python" style="display:none;"><code>from pymongo import MongoClient
# Connect directly using official PyMongo driver on port 27017:
client = MongoClient("mongodb://127.0.0.1:27017")
db = client["faizdb"]
db.inventory.insert_one({"sku": "GPU-5090", "price": 1999.00, "stock": 42})
print("Inserted successfully into unified LSM storage!")</code></pre>
</div>
<div class="sandbox-box">
<div class="sandbox-header">
<span class="sandbox-title">🧪 Live Duality Simulator</span>
<button class="btn-run" onclick="runSandbox(2)">▶ Execute SQL Query on Mongo Document</button>
</div>
<div class="sandbox-output" id="output-2">Click "Execute SQL Query" to simulate cross-dialect query resolution...</div>
</div>
<button class="btn-complete" id="chk-2" onclick="toggleComplete(2)">
✓ Mark Module 2 as Completed
</button>
</section>
<!-- MODULE 3: E-Commerce Ticketing (Zero Oversell MVCC) -->
<section class="module-card" id="module-3">
<div class="module-header">
<div class="module-title-area">
<div class="module-icon">🎫</div>
<div>
<h2 class="module-title">Module 3: E-Commerce & Ticketing (Zero Oversell ACID MVCC)</h2>
<p class="module-sub">Guarantee zero overselling during high-concurrency ticket and flash sale checkouts.</p>
</div>
</div>
</div>
<div class="scenario-box">
<strong>Scenario:</strong> 5,000 concert fans click "Buy Ticket" at the exact same millisecond when only 2 tickets remain. Under standard NoSQL, race conditions cause overselling. FaizDB enforces Multi-Version Concurrency Control (MVCC) with Write-Ahead Log (WAL) safety.
</div>
<div class="code-container">
<div class="code-topbar">
<div class="code-tabs">
<button class="code-tab active" onclick="switchTab(this, 'c3-tx')">ACID Transaction (REST)</button>
<button class="code-tab" onclick="switchTab(this, 'c3-sql')">SQL Staged Mutation</button>
</div>
<button class="btn-copy" onclick="copyCode(this)">Copy</button>
</div>
<pre id="c3-tx"><code># 1. Begin Atomic Snapshot Transaction
curl -X POST http://127.0.0.1:27018/v1/transaction/begin \
-H "Authorization: Bearer <TOKEN>"
# 2. Deduct Seat Inventory (Condition: available_seats > 0)
curl -X POST http://127.0.0.1:27018/v1/collections/tickets/update \
-d '{"query": {"concert": "Coldplay-KL", "seats": {"$gt": 0}}, "update": {"$inc": {"seats": -1}}}'
# 3. Commit atomically (If conflict occurs, transaction aborts cleanly)
curl -X POST http://127.0.0.1:27018/v1/transaction/commit</code></pre>
<pre id="c3-sql" style="display:none;"><code>-- Interactive Shell / psql:
BEGIN TRANSACTION;
UPDATE tickets SET seats = seats - 1 WHERE concert = 'Coldplay-KL' AND seats > 0;
INSERT INTO orders VALUES (101, 'Faiz', 'Coldplay-KL', 350.00, 'PAID');
COMMIT;</code></pre>
</div>
<div class="sandbox-box">
<div class="sandbox-header">
<span class="sandbox-title">🧪 5,000 Concurrent Checkouts Stress Simulation</span>
<button class="btn-run" onclick="runSandbox(3)">▶ Simulate Flash Sale Checkouts</button>
</div>
<div class="sandbox-output" id="output-3">Click "Simulate Flash Sale Checkouts" to test race-condition immunity...</div>
</div>
<button class="btn-complete" id="chk-3" onclick="toggleComplete(3)">
✓ Mark Module 3 as Completed
</button>
</section>
<!-- MODULE 4: AI Vector Search -->
<section class="module-card" id="module-4">
<div class="module-header">
<div class="module-title-area">
<div class="module-icon">🤖</div>
<div>
<h2 class="module-title">Module 4: AI Vector Embeddings & Semantic Search (HNSW)</h2>
<p class="module-sub">Sub-millisecond Approximate Nearest Neighbor (ANN) search inside your database.</p>
</div>
</div>
</div>
<div class="scenario-box">
<strong>Scenario:</strong> You're building an AI Chatbot or Semantic Document Search. Instead of paying for a separate Pinecone or Milvus cluster, FaizDB indexes up to 4,096-dimension vectors natively using SIMD-accelerated HNSW.
</div>
<div class="code-container">
<div class="code-topbar">
<div class="code-tabs">
<button class="code-tab active" onclick="switchTab(this, 'c4-shell')">CLI Utility</button>
<button class="code-tab" onclick="switchTab(this, 'c4-rest')">REST API Endpoint</button>
<button class="code-tab" onclick="switchTab(this, 'c4-node')">TypeScript / Node.js</button>
</div>
<button class="btn-copy" onclick="copyCode(this)">Copy</button>
</div>
<pre id="c4-shell"><code># Inside faizdb shell:
demo vector
# Output will index 4 concept vectors and perform sub-millisecond similarity search!</code></pre>
<pre id="c4-rest" style="display:none;"><code># Ingest vector embedding into 'knowledge_base' collection:
curl -X POST http://127.0.0.1:27018/v1/vector/search \
-H "Content-Type: application/json" \
-d '{
"collection": "articles",
"query_vector": [0.92, 0.88, 0.08, 0.06],
"top_k": 3,
"metric": "Cosine"
}'</code></pre>
<pre id="c4-node" style="display:none;"><code>import fetch from 'node-fetch';
const res = await fetch('http://localhost:27018/v1/vector/search', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
collection: 'faq',
query_vector: [0.15, 0.82, 0.33, 0.91],
top_k: 2
})
});
const matches = await res.json();
console.log('Top match similarity:', matches[0].similarity);</code></pre>
</div>
<div class="sandbox-box">
<div class="sandbox-header">
<span class="sandbox-title">🧪 HNSW Vector ANN Matcher Simulator</span>
<button class="btn-run" onclick="runSandbox(4)">▶ Search Semantic Similarity (Cosine Metric)</button>
</div>
<div class="sandbox-output" id="output-4">Click "Search Semantic Similarity" to compute sub-ms vector distance...</div>
</div>
<button class="btn-complete" id="chk-4" onclick="toggleComplete(4)">
✓ Mark Module 4 as Completed
</button>
</section>
<!-- MODULE 5: GraphRAG Knowledge Graph -->
<section class="module-card" id="module-5">
<div class="module-header">
<div class="module-title-area">
<div class="module-icon">🕸️</div>
<div>
<h2 class="module-title">Module 5: GraphRAG & Multi-Hop Entity Traversal</h2>
<p class="module-sub">Ground AI prompts with interconnected knowledge graphs to eliminate hallucination.</p>
</div>
</div>
</div>
<div class="scenario-box">
<strong>Scenario:</strong> AI models hallucinate when isolated vectors lack relational context. GraphRAG connects entities (e.g. <code>User -> PURCHASED -> Device -> SHIPPED_BY -> Courier</code>) and retrieves multi-hop context in 1 single traversal.
</div>
<div class="code-container">
<div class="code-topbar">
<div class="code-tabs">
<button class="code-tab active" onclick="switchTab(this, 'c5-cli')">CLI Graph Demo</button>
<button class="code-tab" onclick="switchTab(this, 'c5-rest')">REST Traversal API</button>
</div>
<button class="btn-copy" onclick="copyCode(this)">Copy</button>
</div>
<pre id="c5-cli"><code># Inside faizdb shell:
demo graph
# Traverses knowledge graph from 'Ahmad' across 3 hops in 0.04ms!</code></pre>
<pre id="c5-rest" style="display:none;"><code># Multi-hop Breadth-First Search (BFS) graph query:
curl -X POST http://127.0.0.1:27018/v1/graph/traverse \
-H "Content-Type: application/json" \
-d '{
"start_node": "developer_faiz",
"relationship": "CONTRIBUTES_TO",
"max_depth": 2
}'</code></pre>
</div>
<div class="sandbox-box">
<div class="sandbox-header">
<span class="sandbox-title">🧪 Multi-Hop BFS Graph Traversal Simulator</span>
<button class="btn-run" onclick="runSandbox(5)">▶ Traverse Knowledge Graph (2 Hops)</button>
</div>
<div class="sandbox-output" id="output-5">Click "Traverse Knowledge Graph" to execute BFS relational traversal...</div>
</div>
<button class="btn-complete" id="chk-5" onclick="toggleComplete(5)">
✓ Mark Module 5 as Completed
</button>
</section>
<!-- MODULE 6: Robotics & Edge IoT Streaming -->
<section class="module-card" id="module-6">
<div class="module-header">
<div class="module-title-area">
<div class="module-icon">🤖</div>
<div>
<h2 class="module-title">Module 6: Robotics & Edge IoT Sensor Streaming (128Hz)</h2>
<p class="module-sub">Memory-capped 16MB/32MB telemetry for Raspberry Pi, Nvidia Jetson, and microchips.</p>
</div>
</div>
</div>
<div class="scenario-box">
<strong>Scenario:</strong> Warehouse robots and drones record telemetry at 128Hz. Heavy databases crash with Out-Of-Memory (OOM) or cause micro-stutters when garbage collection fires. FaizDB operates at 0 GC pauses with a strict 32MB RAM ceiling and offline WAL buffering.
</div>
<div class="code-container">
<div class="code-topbar">
<div class="code-tabs">
<button class="code-tab active" onclick="switchTab(this, 'c6-studio')">Web Studio Control Center</button>
<button class="code-tab" onclick="switchTab(this, 'c6-robot')">Robot Telemetry Ingest</button>
</div>
<button class="btn-copy" onclick="copyCode(this)">Copy</button>
</div>
<pre id="c6-studio"><code>1. Open FaizDB Studio: http://localhost:27020
2. Click the new "Robot & Edge Chip" icon on the sidebar.
3. Choose your Hardware Profile:
- Microcontroller (16MB Cap)
- Robotics SBC (32MB Cap)
- Autonomous AI Robot (64MB Cap)
4. Click "Start 128Hz Stream" to watch real-time IMU & vision vector telemetry!</code></pre>
<pre id="c6-robot" style="display:none;"><code>// Python on Raspberry Pi / Nvidia Jetson:
import requests, time
while True:
payload = {
"sensor": "IMU-6DOF",
"pitch": 0.42, "roll": -0.15, "lidar_m": 1.84,
"embedding": [0.84, 0.12, 0.65, 0.33]
}
requests.post("http://127.0.0.1:27018/v1/collections/robot_feed/insert", json=payload)
time.sleep(1/128) # 128Hz tick loop</code></pre>
</div>
<div class="sandbox-box">
<div class="sandbox-header">
<span class="sandbox-title">🧪 128Hz Sensor Ingestion Simulator</span>
<button class="btn-run" onclick="runSandbox(6)">▶ Simulate 128Hz Telemetry Tick</button>
</div>
<div class="sandbox-output" id="output-6">Click "Simulate 128Hz Telemetry Tick" to test microsecond edge ingestion...</div>
</div>
<button class="btn-complete" id="chk-6" onclick="toggleComplete(6)">
✓ Mark Module 6 as Completed
</button>
</section>
<!-- MODULE 7: Distributed EXPLAIN ANALYZE -->
<section class="module-card" id="module-7">
<div class="module-header">
<div class="module-title-area">
<div class="module-icon">📊</div>
<div>
<h2 class="module-title">Module 7: Distributed EXPLAIN ANALYZE & Visual Profiling</h2>
<p class="module-sub">Inspect Node-Tree plans, Shard Flame Graphs, and PostgreSQL wire format.</p>
</div>
</div>
</div>
<div class="scenario-box">
<strong>Scenario:</strong> A distributed query is taking longer than expected. You need to identify whether network shuffle, an inefficient join strategy, or a slow straggler shard is causing the delay.
</div>
<div class="code-container">
<div class="code-topbar">
<div class="code-tabs">
<button class="code-tab active" onclick="switchTab(this, 'c7-sql')">EXPLAIN ANALYZE Query</button>
<button class="code-tab" onclick="switchTab(this, 'c7-psql')">PostgreSQL Wire Output</button>
</div>
<button class="btn-copy" onclick="copyCode(this)">Copy</button>
</div>
<pre id="c7-sql"><code>-- Execute full distributed profiling in faizdb shell or Query Console:
EXPLAIN (ANALYZE, VERBOSE, COSTS)
SELECT o.order_id, u.name, o.amount
FROM orders o
JOIN users u ON o.user_id = u.id
WHERE o.status = 'COMPLETED';</code></pre>