db summary

This commit is contained in:
Philippe Pittoli 2025-04-29 19:26:49 +02:00
parent 217b833572
commit af38aa98d3
2 changed files with 69 additions and 4 deletions

54
paper/db-summary.pic Normal file
View file

@ -0,0 +1,54 @@
.PS
colheight = -1.5
colwidth = 2.0
.gcolor white
COL0: line from Here to Here + (0,colheight)
.gcolor
COL1: line same from COL0 + (0.9, 0)
COL2: line same from COL1 + (colwidth, 0)
COL3: line same from COL2 + (colwidth, 0)
COL4: line same from COL3 + (colwidth, 0)
txtdist = -0.1
row1 = -0.2
rowdist = -0.4
.ps +2
RAMONLY: "RAM-only" rjust at COL1 + (txtdist, row1)
CACHE: "Cache" rjust at RAMONLY + (0, rowdist)
box wid 7.2 with .w at CACHE + (-0.9, rowdist) shaded "green"
COMMON: "Common" rjust at CACHE + (0, rowdist)
UNCACHED: "Uncached" rjust at COMMON + (0, rowdist)
.ps
.ps +4
SPEED: "Speed" at 1/2 between COL1 and COL2 + (0, 0.5)
MEMORY: "Memory use" at 1/2 between COL2 and COL3 + (0, 0.5)
PERSISTANCE: "Persistance" at 1/2 between COL3 and COL4 + (0, 0.5)
.ps
.ps +2
"Ultra fast" at (SPEED,RAMONLY)
.gcolor red
"Entire data-set" at (MEMORY,RAMONLY)
"No" at (PERSISTANCE,RAMONLY)
.gcolor
"Ultra fast" at (SPEED,CACHE)
.gcolor red
"Entire data-set" at (MEMORY,CACHE)
.gcolor
"Yes" at (PERSISTANCE,CACHE)
"Fast most of the time" at (SPEED,COMMON)
"Configurable" at (MEMORY,COMMON)
"Yes" at (PERSISTANCE,COMMON)
.gcolor red
"Slow" at (SPEED,UNCACHED)
.gcolor
"Almost none" at (MEMORY,UNCACHED)
"Yes" at (PERSISTANCE,UNCACHED)
.ps
.PE

View file

@ -266,9 +266,9 @@ This is a simple object
with a name, a color and a list of associated keywords (fast, elegant, etc.). with a name, a color and a list of associated keywords (fast, elegant, etc.).
.SOURCE Ruby ps=9 vs=10 .SOURCE Ruby ps=9 vs=10
class Car class Car
property name : String # ex: Corvet property name : String # e.g. Corvet
property color : String # ex: red property color : String # e.g. red
property keywords : Array(String) # ex: [fast, impressive] property keywords : Array(String) # e.g. [fast, impressive]
end end
.SOURCE .SOURCE
. .
@ -965,7 +965,18 @@ The duration of the request would then be the addition of both tag requests and
. .
. .
.SS Summary of the different databases and their use .SS Summary of the different databases and their use
.LP The following table shows the differences between the database implementations in DODB.
.so db-summary.pic
.QP
To put things into perspective, request duration is 120 ns for RAM-only and Cache databases and
200 ns for Common database (a 67 % slow down, but still impressive) when on a cache hit (22 µs otherwise, such as uncached database),
uncached database is 170 to 180 times slower than RAM-only (22 µs vs 120 ns) which still could be acceptable but Common database should be considered instead.
Both RAM-only and Cache databases require to keep the entire database in-memory.
The Common database can be tailored to any particular situation as long as a LRU eviction policy is relevant.
Uncached database doesn't keep anything in-memory.
.QE
.B "RAM-only database" .B "RAM-only database"
is the fastest database but dedicated to short-lived data (data is not saved on disk). is the fastest database but dedicated to short-lived data (data is not saved on disk).