Académique Documents
Professionnel Documents
Culture Documents
Harmful
Shannon Posniewski
Cryptic Studios
GDC 2008
Current Relational
DBMSs are
Inappropriate for Low-
Latency, Controlled
Working-Set
Databases
and what we did trying to circumvent
that
and how that
Shannon didn’t work out very well
Posniewski
Database
Fundamentals
Relational
Object
Object-Relational
Hierarchical
etc.
Relational Model
Defined mathematically
Based on
set theory
predicate logic
Relational Database
Tables
Rows
aka records
aka entities
Columns
values for that entity
SQL
Class ID Name
1 Elf
2 Orc
3 Monkey
SQL DBMSs
Abandons relational DB
concepts
Solution: Caching
AUTO_STRUCT AST_CONTAINER;
typedef struct Entity
{
} Entity;
Struct Metadata
Transaction
Cryptic DB
Server
Team
Map Server
Server Map Server
Map Server
Cryptic Engine
Transactions
Local if possible
Dispatched by Transaction Server
if not
AUTO_TRANSACTIONS in C
Field-level locking
AUTO_TRANSACTION
C code plus special macros
AUTO_TRANSACTION;
enumTransactionOutcome trGiveGold(ATR_ARGS,
NOCONST(Entity) *pEnt1,
NOCONST(Entity) *pEnt2,
int amount)
{
if (pEnt1->gold < amount)
TRANSACTION_RETURN(TRANSACTION_OUTCOME_FAILURE,
”NotEnoughGold”);
pEnt1->gold -= amount;
pEnt2->gold += amount;
return TRANSACTION_OUTCOME_SUCCESS;
}
Transaction
Server Step 1
Trans(“DoTrade”, A, B)
A DoTrade B
Server 1 Server 2
Transaction
Server Step 2
1
2
3
4
…
1
Trans(“DoTrade”,
2 A, B)
3
4
…
A DoTrade B
Server 1 Server 2
Transaction
Server Step 3
1
2
3
4
…
A DoTrade B
Server 1 Server 2
Transaction
Server Step 4
1
2
3
4
…
B B’
DoTrade
A A’ B
Server 1 Server 2
Transaction
Server Step 4
1
2
3
4
…
B
dB
dB
B’
B’
A A’ B
Server 1 Server 2
Transaction
Server Step 4
1
2
3
4
…
A’ B’
Server 1 Server 2
Abstract Cryptic DB
Get transaction
Log it to journal
Apply change to in-memory DB
Occasionally write out updated DB
file
Mark the journal resolved to that
point
Copyright 2008 Cryptic Studios,
We’re hiring! Apply Online!