a rest protocol for horizontally scalable cloud database access
TRANSCRIPT
Amazon EC2 Ireland
Benchmark Instance
Web-Fronted
Benchmark Instance
Web-Fronted
...OS: Windows ServerSize: 1 core, 1 GB RAM
50 parallel instances
Benchmark Instance
Web-Fronted
Launched simultaneously
IIIInnttterrnnnneeeeettttInternetSquid Web
Cache
OS: LinuxSize: 2 cores, 7.5 GB RAM
Ore
stes Versant
Object Database
OS: Windows ServerSize: 2 cores, 7.5 GB RAM
Laun
cher
165ms Amazon EC2 California
Orestes: a REST protocol for horizontally scalable cloud database access
Observations
Reduction of server load Low latency
IIIIIIInnnnttttteeeeeerrrrrnnnnnnnneeeeeeeeetttttttttttInternet OrestesCache
Arrivingrequests
Requests reaching the server
IIIIIIInnnttttttteeeeeerrrrrnnnnnnnnnneeeeeeeettttttttttttInternetOrestes Cache
Low latency High latency
Orestes
Arbitrary combinations of persistence API and DB Reads scale horizontally
JavaScript JPA Orestes
Open protocol
Orestes
HTTP and JSON
VOD
Java JDO Orestes Orestes db4o
Different database systemsDifferent programming languages / APIs
IIIIIIInnnntttttteeeeeerrrrrnnnnnnnneeeeeeeeettttttttttttInternet OrestesLoad-Balancer
Arrivingrequests Scale-out
B
CacheCacheCacheCache writes
changes
Reads don't reach the server
PPPPPPPPPaaaaaaaaaaaaaaaaaaSSSSSSSSSSSCCCCClllooooooouuuuuuuuddddddddddddddPaaSCloud
CCCCCCllllllooooouuuuuuuuddddddddddddCloudOrestes as a
ServiceO
Orestes ApplicationOrestes
Application deployed in cloud
On premise application
Firewalls, proxys, load-balancers
AAAAAAAAAAA
Cloud and service capable DB interface
Browser persistence and administration
IIIIIIIInnnntttttteeeeeerrrrnnnnnnnneeeeeeeeettttttttttttInternet Orestes
Remote database
Browser
Accounts, data analysis, monitoring...
Direct database access from client side
s
Solution
Open problems: Database as a service, cloud computing
network latency Web-scale applications, commodity hardware
scalability issues Goal: Scalable, cloud capable database systems Our approach: ORESTES (Objects RESTfully encapsulated in standard formats)
Property Mechanism
Read scalability Web caching of database objects
Low latency Cache deployment in client network
Loose coupling of persistence API and DB
Generic HTTP access protocol and resource structure
Standard formats
Extensible HTTP content negotiation + default JSON formats
Felix Gessert, Florian Bücklers, Norbert Ritter University of Hamburg
Illustration of the Key Properties
System Overview
Caching mechanism: HTTP caching with statically assigned object lifetimes
Server
Persistence API
OrestesInterface RESTful HTTP
Orestes Protocol
Database Interface
OrestesClient
D bPersistence
Client
OrestesServer
OrestesInterface
Application Database
Scales horizontally
Orestes layer
Visit us at the URL http://orestes.info or contact us via email: [email protected]
Orestesserver(America)
caches(Hamburg)
benchmarkclient(Hamburg) 1 2 3
123
Orestes without cache
VOD native
Orestes with cacheOrestesO
IIIIIIIIIIInnnnnnnnnnnttttttttteeeeeeeeeeeeeeerrrrrrrrrrrrnnnnnnnnnnnnnnneeeeeeeeeeeeeeeeeeeetttttttttttInternet
LL2-JDOCaaache
L2-JDOCache
Different forward proxy caches
Round-trip time 180ms ± 5ms
Compared benchmark setups
Squid 2, Squid 3, Microsoft TMG
Benchmark procedure: starting with cold cache, performing 50/500 operations in 3 consecutive runs, using a read/write ratio of 50/90/99% and a working set size of 300 objects
Benchmarking the Protocol
Further Information
Single Client Scenario
50 100 150 200 250
300 / 1300 / 2300 / 3
3000 / 13000 / 23000 / 3
30000 / 130000 / 230000 / 3
Time [s]
Setu
p [#
obje
cts/
run]
VOD nativeOrestes
0 100 200 300 400 500 600
O: Squid 2O: Squid 3
O: TMGO: no cacheVOD: native
Latency [ms]
Setu
p
Cloud Computing Scenario Future Work
Conclusions
00 12550
Other (e.g. query)ReadsWrite
Cache is warming up
1. Run
2. Run
3. Run
100
O: Squid 2
O: Squid 3
O: Squid3 pa.
O: TMG
O: no cache
VOD: native
Ops: 500, Reads: 99%, 3. Run
Setu
p
450 reads/50 writes over 3 runs
Read-heavy scenario, warm cache
Execution Time [s] Execution Time [s]
VOD native Orestes
Preventing stale reads and transaction aborts using bloom filters:
ClientOrestesServer
Database
PUT/POST ObjectWritexWritex-1..Writey
Write-Lognow
TTL days ago
1 0 0 1 1 0 1 1h1
hk
...
foreach(OID)
OID
bit vector(Bloom filter)
hash functions
GET Writes since TTL
set bit to 1
Network Application
Bloo
m-F
ilter
IIInntttteeeerrrrnneeeeetttaannddd CCCaaaccchhheeessss
Internetand Caches
Writ
e-Lo
ggin
g
isStale(OID)?
1 0 0 1 1 0 1 1
1 0 0 1 1 0 1 1
contains?
Make O(1) check before each GET
if necessary: revalidate
Average execution time of 50 concurrent clients
Benchmark procedure: starting with cold cache, 500 operations, 3 consecutive runs, read/write ratio of 90%, 300/3000/30000 total database objects, 50 concurrent clients
Further caching support: server-side invalidation for content delivery networks and server-controlled reverse proxy caches.
We achieved: • Read scalability through web caching• Considerable reduction of network latency • Increase of read performance through caching of
working sets Orestes: a novel approach to achieve read scalability for transactional object oriented persistenceOpen problem: write scalability
Effects of cache hits: reducing the latency of object access by orders of magnitude
local in-memory cache hits
cache hits cache misses
Scenario social networking OO model inheritance, aggregation, etc. Access pattern transactional navigation Database Versant Object Database (VOD) Persistence API Java Data Objects (JDO) Protocols VOD TCP, Orestes Caches JDO L2 (VOD), web caches (Orestes) Concurrency single client, 50 parallel clients
DatabaseGeneric Orestes HTTP Protocol Internet
Java Data Objects
Java Persistence
API Port
pm.makePersistent(obj)
JavaScript
Java
pm.getObjectById(id)
pm.newQuery(qry)
em.persist(obj)
em.find(cls,id)
em.createQuery(qry,cls)
HTTP
Persistence API Generic Orestes HTTP Protocol
HTTP
Versant Object
Database
db4o
Bind
ing
Bind
ing
Optional web cache in client's network (forward proxy cache)
Optional web cache in servers's network (reverse proxy cache)
Web Cache
Web Cache Cluster
GET /db/sim.classes/Person/22517998If-None-Match: "2"Cache-Control: max-age=0Accept: application/json
Works in web browser (AJAX) and Node.js
Caches at ISPs
HTTP requestHTTP response
{ "_objectInfo": { "class": "/db/sim.classes/Person", "oid": "/db/sim.classes/Person/22517998", "version": "2" }, "/db/sim.classes/Site": { "owner": "/db/sim.classes/Person/22517998", "title": "Profile of Bethold Birnenbaum", "posts": [], "design": "Colorful" }, "/db/sim.classes/Person": { "status": "Chilling!", "family": [], "friends": [], "profile": "/db/sim.classes/Profile/22517998", "games": [] }}
200 OKCache-Control: public,max-age=1209600Content-Type: application/jsonETag: "2"
Content Delivery Networks (CDN)
Synchronization: Optimistic concurrency control to deal with stale objects
Implementation: Generic network layer, 2 persistence APIs, 2 DB bindings