SlideShare ist ein Scribd-Unternehmen logo
1 von 27
IMDB Showdown
@robertfriberg
robert@devrexlabs.com
origodb.com
Speed of light vs spinning metal
What Time Scale
L1 Cache 0.5 ns 0.008 2 m
L2 Cache 7 ns 0.23
RAM 60 ns 1 240 m 1 second
1K over Gbit network 10 µs 167 2.5 minutes
4K read SSD 150 µs 2500
Rotating disk seek 10 ms 167000 40000 km 46 hours
Price/GB vs GB/Server 1980- 2015
8 USD
6.480.000 USD
0.001 GB
2000 GB
In-memory stores
• VoltDB
• MemSQL
• Hazelcast
• Aerospike
• Memcached
• Oracle Coherence
• Redis
• Oracle Times Ten
• SQL Server
In-memory OLTP
• SAP Hana
• OrigoDB
Key/value
New SQL Hybrid
?
1. SQL Server
In-memory OLTP
B-trees and Transactions
LOG
DATA 64KB blocks w 8x8KB pages
Logical BTREE of 8kb data pages
In the buffer pool (cache)
Buffer
Manager
Transactions append inserted, deleted, original and modified pages to the LOG
CHECKPOINT
SQL Server In-memory OLTP
SP
Logging
Latches
Locks
Buffer Manager I/O
Native compiled SPs
Minimal Logging and
checkpointing
Lock-free data structures
Multi-version Currency
control
In Memory and Memory
optimized data structures
Sql Server In-memory OLTP
• Heka = Greek for 100
• Transparent for application
• Integrates with Sql Server but with limitations
• Enterprise license
• 5-30x performance gain
Demo!
2. Redis
REmote DIctionary Server
• Hybrid Key/Value store
• Value -> String | List | Set | Hash | SortedSet
• Predefined Commands -> SET | GET | HSET | ...
• Persistence: Snapshots + AOF
• Highly optimized C, fast algorithms
Twitter using redis
INCR next_user_id //returns 1000
HMSET user:1000 name bart password ¤¤¤hash¤¤¤
HSET users bart 1000
ZADD followers:1000 1401267618 1234
ZADD following:1234 1401267618 1000
INCR next_post_id => 10343
HMSET post:10343 user 1000 time $time body ’Ay Caramba’
RPUSH posts:1000 10343
3. OrigoDB
Build faster systems faster
What’s the problem?
Service
Layer
Domain
Layer
Data Access
Layer
Relational
Model
Views/SP’s
Cache
One simple idea...
Keep state in memory
Persist operations, not system state
s0 s1 s2
op1 op2
Sn = apply(opn, Sn-1)
... with many names
• System prevalance – Prevalyer, java
• MongoDB op log
• Redis AOF
• Memory Image – Martin Fowler
• VoltDB – logical logging
• Akka persistence – logging per actor
• Event Sourcing
OrigoDB
Kernel
Engine
Model
Storage
App Code
Server
Command
Query
File
Sql
Event Store
Custom
Consistency
Isolation
concurrency
Sends commands and queries
Journaling
Snapshots
BinaryFormatter
ProtoBuf
JSON
tcp
JSON/http
In-process
calls
Domain specific
object-graph
Domain specific operations
Replication
Ad-hoc queries
Web ui
Console or win svc
Complete history of events
• Point in time
• Debugging
• Restore
• Queries
• Audit trail
• New interpretations
Example – the model
[Serializable]
public class CommerceModel : Model
{
internal SortedDictionary<Guid, Customer> Customers { get; set; }
internal SortedDictionary<Guid, Order> Orders { get; set; }
internal SortedDictionary<Guid, Product> Products { get; set; }
public CommerceModel()
{
Customers = new SortedDictionary<Guid, Customer>();
Orders = new SortedDictionary<Guid, Order>();
Products = new SortedDictionary<Guid, Product>();
}
}
Command
[Serializable]
public class AddCustomer : Command<CommerceModel>
{
public readonly Guid Id;
public readonly string Name;
public AddCustomer(Guid id, String name)
{
Id = id;
Name = name;
}
public override void Execute(CommerceModel model)
{
if (model.Customers.ContainsKey(Id)) Abort("Duplicate customer id");
var customer = new Customer {Id = Id, Name = Name};
model.Customers.Add(Id, customer);
}
}
Query
[Serializable]
public class CustomerById : Query<CommerceModel, CustomerView>
{
public readonly Guid Id;
public CustomerById(Guid id)
{
Id = id;
}
public override CustomerView Execute(CommerceModel model)
{
if (!model.Customers.ContainsKey(Id)) throw new Exception("no such customer");
return new CustomerView(model.Customers[Id]);
}
}
Start your engines!
static void Main(string[] args)
{
var engine = Engine.For<CommerceModel>();
Guid id = Guid.NewGuid();
var customerCommand = new AddCustomer(id, "Homer");
engine.Execute(customerCommand);
var customerView = engine.Execute(new CustomerById(id));
Console.WriteLine(customerView.Name);
Console.WriteLine("{0} orders", customerView.OrderIds.Count);
Console.ReadLine();
}
Demo!
Geekstream
4. Conclusion
The old, the new and the ugly
100% ACID Out of the Box?
SQL Server Redis OrigoDB
Atomicity NO NO YES
Consistency NO NO YES
Isolation NO YES YES
Durability YES YES YES
Comparison Matrix
SQL REDIS ORIGO
License/Cost $$ OSS/Free MIT/Free (+$)
Language TSQL Commands + Lua C#/LINQ
OLTP YES YES YES
OLAP (indexing) YES NO YES
In-process NO NO YES
Througput/latency 3 1 2
Modeling Relational Fixed Multi
Maturity 1 2 3
Size 250GB/DB Available RAM Available RAM
Thank you!
• Try Origo!
• Contribute, it’s open source
• http://origodb.com
• @robertfriberg, robert@devrexlabs.com

Weitere ähnliche Inhalte

Was ist angesagt?

Sphinx at Craigslist in 2012
Sphinx at Craigslist in 2012Sphinx at Craigslist in 2012
Sphinx at Craigslist in 2012Jeremy Zawodny
 
MySQL And Search At Craigslist
MySQL And Search At CraigslistMySQL And Search At Craigslist
MySQL And Search At CraigslistJeremy Zawodny
 
Presto Meetup (2015-03-19)
Presto Meetup (2015-03-19)Presto Meetup (2015-03-19)
Presto Meetup (2015-03-19)Dain Sundstrom
 
Living with SQL and NoSQL at craigslist, a Pragmatic Approach
Living with SQL and NoSQL at craigslist, a Pragmatic ApproachLiving with SQL and NoSQL at craigslist, a Pragmatic Approach
Living with SQL and NoSQL at craigslist, a Pragmatic ApproachJeremy Zawodny
 
Engineering an Encrypted Storage Engine
Engineering an Encrypted Storage EngineEngineering an Encrypted Storage Engine
Engineering an Encrypted Storage EngineMongoDB
 
Azure DocumentDB 101
Azure DocumentDB 101Azure DocumentDB 101
Azure DocumentDB 101Ike Ellis
 
Realtime Search Infrastructure at Craigslist (OpenWest 2014)
Realtime Search Infrastructure at Craigslist (OpenWest 2014)Realtime Search Infrastructure at Craigslist (OpenWest 2014)
Realtime Search Infrastructure at Craigslist (OpenWest 2014)Jeremy Zawodny
 
Fusion-io and MySQL at Craigslist
Fusion-io and MySQL at CraigslistFusion-io and MySQL at Craigslist
Fusion-io and MySQL at CraigslistJeremy Zawodny
 
Потоковая фильтрация событий
Потоковая фильтрация событийПотоковая фильтрация событий
Потоковая фильтрация событийCEE-SEC(R)
 
Share point 2013 on azure
Share point 2013 on azureShare point 2013 on azure
Share point 2013 on azurePrabath Fonseka
 
Inside sql server in memory oltp sql sat nyc 2017
Inside sql server in memory oltp sql sat nyc 2017Inside sql server in memory oltp sql sat nyc 2017
Inside sql server in memory oltp sql sat nyc 2017Bob Ward
 
Building Codealike: a journey into the developers analytics world
Building Codealike: a journey into the developers analytics worldBuilding Codealike: a journey into the developers analytics world
Building Codealike: a journey into the developers analytics worldOren Eini
 
Benchmarking Redis by itself and versus other NoSQL databases
Benchmarking Redis by itself and versus other NoSQL databasesBenchmarking Redis by itself and versus other NoSQL databases
Benchmarking Redis by itself and versus other NoSQL databasesItamar Haber
 
The ELK Stack - Get to Know Logs
The ELK Stack - Get to Know LogsThe ELK Stack - Get to Know Logs
The ELK Stack - Get to Know LogsGlobalLogic Ukraine
 
Windows Server 2012 Developer Preview Active Directory Backup Restore
Windows Server 2012 Developer Preview Active Directory Backup RestoreWindows Server 2012 Developer Preview Active Directory Backup Restore
Windows Server 2012 Developer Preview Active Directory Backup RestoreSerhad MAKBULOĞLU, MBA
 
ELK Wrestling (Leeds DevOps)
ELK Wrestling (Leeds DevOps)ELK Wrestling (Leeds DevOps)
ELK Wrestling (Leeds DevOps)Steve Elliott
 
Gr8Conf 2016 - What's new in Grails 3
Gr8Conf 2016 - What's new in Grails 3Gr8Conf 2016 - What's new in Grails 3
Gr8Conf 2016 - What's new in Grails 3graemerocher
 
RavenDB Presentation
RavenDB PresentationRavenDB Presentation
RavenDB PresentationMark Rodseth
 

Was ist angesagt? (20)

Sphinx at Craigslist in 2012
Sphinx at Craigslist in 2012Sphinx at Craigslist in 2012
Sphinx at Craigslist in 2012
 
MySQL And Search At Craigslist
MySQL And Search At CraigslistMySQL And Search At Craigslist
MySQL And Search At Craigslist
 
Presto Meetup (2015-03-19)
Presto Meetup (2015-03-19)Presto Meetup (2015-03-19)
Presto Meetup (2015-03-19)
 
Living with SQL and NoSQL at craigslist, a Pragmatic Approach
Living with SQL and NoSQL at craigslist, a Pragmatic ApproachLiving with SQL and NoSQL at craigslist, a Pragmatic Approach
Living with SQL and NoSQL at craigslist, a Pragmatic Approach
 
Engineering an Encrypted Storage Engine
Engineering an Encrypted Storage EngineEngineering an Encrypted Storage Engine
Engineering an Encrypted Storage Engine
 
Azure DocumentDB 101
Azure DocumentDB 101Azure DocumentDB 101
Azure DocumentDB 101
 
Realtime Search Infrastructure at Craigslist (OpenWest 2014)
Realtime Search Infrastructure at Craigslist (OpenWest 2014)Realtime Search Infrastructure at Craigslist (OpenWest 2014)
Realtime Search Infrastructure at Craigslist (OpenWest 2014)
 
Fusion-io and MySQL at Craigslist
Fusion-io and MySQL at CraigslistFusion-io and MySQL at Craigslist
Fusion-io and MySQL at Craigslist
 
Потоковая фильтрация событий
Потоковая фильтрация событийПотоковая фильтрация событий
Потоковая фильтрация событий
 
Share point 2013 on azure
Share point 2013 on azureShare point 2013 on azure
Share point 2013 on azure
 
TPC-H in MongoDB
TPC-H in MongoDBTPC-H in MongoDB
TPC-H in MongoDB
 
Inside sql server in memory oltp sql sat nyc 2017
Inside sql server in memory oltp sql sat nyc 2017Inside sql server in memory oltp sql sat nyc 2017
Inside sql server in memory oltp sql sat nyc 2017
 
Building Codealike: a journey into the developers analytics world
Building Codealike: a journey into the developers analytics worldBuilding Codealike: a journey into the developers analytics world
Building Codealike: a journey into the developers analytics world
 
Benchmarking Redis by itself and versus other NoSQL databases
Benchmarking Redis by itself and versus other NoSQL databasesBenchmarking Redis by itself and versus other NoSQL databases
Benchmarking Redis by itself and versus other NoSQL databases
 
The ELK Stack - Get to Know Logs
The ELK Stack - Get to Know LogsThe ELK Stack - Get to Know Logs
The ELK Stack - Get to Know Logs
 
Windows Server 2012 Developer Preview Active Directory Backup Restore
Windows Server 2012 Developer Preview Active Directory Backup RestoreWindows Server 2012 Developer Preview Active Directory Backup Restore
Windows Server 2012 Developer Preview Active Directory Backup Restore
 
ELK Wrestling (Leeds DevOps)
ELK Wrestling (Leeds DevOps)ELK Wrestling (Leeds DevOps)
ELK Wrestling (Leeds DevOps)
 
Gr8Conf 2016 - What's new in Grails 3
Gr8Conf 2016 - What's new in Grails 3Gr8Conf 2016 - What's new in Grails 3
Gr8Conf 2016 - What's new in Grails 3
 
RavenDB Presentation
RavenDB PresentationRavenDB Presentation
RavenDB Presentation
 
KeyValue Stores
KeyValue StoresKeyValue Stores
KeyValue Stores
 

Ähnlich wie IMDB Showdown - OrigoDB, Redis and Hekaton

OrigoDB - Your data fits in RAM
OrigoDB - Your data fits in RAMOrigoDB - Your data fits in RAM
OrigoDB - Your data fits in RAMRobert Friberg
 
Agility and Scalability with MongoDB
Agility and Scalability with MongoDBAgility and Scalability with MongoDB
Agility and Scalability with MongoDBMongoDB
 
OrigoDB - take the red pill
OrigoDB - take the red pillOrigoDB - take the red pill
OrigoDB - take the red pillRobert Friberg
 
FlashSQL 소개 & TechTalk
FlashSQL 소개 & TechTalkFlashSQL 소개 & TechTalk
FlashSQL 소개 & TechTalkI Goo Lee
 
Hoodie: Incremental processing on hadoop
Hoodie: Incremental processing on hadoopHoodie: Incremental processing on hadoop
Hoodie: Incremental processing on hadoopPrasanna Rajaperumal
 
CosmosDB for IoT Scenarios
CosmosDB for IoT ScenariosCosmosDB for IoT Scenarios
CosmosDB for IoT ScenariosIvo Andreev
 
Accelerating HBase with NVMe and Bucket Cache
Accelerating HBase with NVMe and Bucket CacheAccelerating HBase with NVMe and Bucket Cache
Accelerating HBase with NVMe and Bucket CacheNicolas Poggi
 
SharePoint Saturday San Antonio: SharePoint 2010 Performance
SharePoint Saturday San Antonio: SharePoint 2010 PerformanceSharePoint Saturday San Antonio: SharePoint 2010 Performance
SharePoint Saturday San Antonio: SharePoint 2010 PerformanceBrian Culver
 
Proving out flash storage array performance using swingbench and slob
Proving out flash storage array performance using swingbench and slobProving out flash storage array performance using swingbench and slob
Proving out flash storage array performance using swingbench and slobKapil Goyal
 
SQL Now! How Optiq brings the best of SQL to NoSQL data.
SQL Now! How Optiq brings the best of SQL to NoSQL data.SQL Now! How Optiq brings the best of SQL to NoSQL data.
SQL Now! How Optiq brings the best of SQL to NoSQL data.Julian Hyde
 
DevOps for ETL processing at scale with MongoDB, Solr, AWS and Chef
DevOps for ETL processing at scale with MongoDB, Solr, AWS and ChefDevOps for ETL processing at scale with MongoDB, Solr, AWS and Chef
DevOps for ETL processing at scale with MongoDB, Solr, AWS and ChefGaurav "GP" Pal
 
stackArmor presentation for DevOpsDC ver 4
stackArmor presentation for DevOpsDC ver 4stackArmor presentation for DevOpsDC ver 4
stackArmor presentation for DevOpsDC ver 4Gaurav "GP" Pal
 
Sharding Methods for MongoDB
Sharding Methods for MongoDBSharding Methods for MongoDB
Sharding Methods for MongoDBMongoDB
 
Scality S3 Server: Node js Meetup Presentation
Scality S3 Server: Node js Meetup PresentationScality S3 Server: Node js Meetup Presentation
Scality S3 Server: Node js Meetup PresentationScality
 
SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...
SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...
SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...Chester Chen
 
ログ収集プラットフォーム開発におけるElasticsearchの運用
ログ収集プラットフォーム開発におけるElasticsearchの運用ログ収集プラットフォーム開発におけるElasticsearchの運用
ログ収集プラットフォーム開発におけるElasticsearchの運用LINE Corporation
 
EVCache: Lowering Costs for a Low Latency Cache with RocksDB
EVCache: Lowering Costs for a Low Latency Cache with RocksDBEVCache: Lowering Costs for a Low Latency Cache with RocksDB
EVCache: Lowering Costs for a Low Latency Cache with RocksDBScott Mansfield
 

Ähnlich wie IMDB Showdown - OrigoDB, Redis and Hekaton (20)

OrigoDB - Your data fits in RAM
OrigoDB - Your data fits in RAMOrigoDB - Your data fits in RAM
OrigoDB - Your data fits in RAM
 
In-memory Databases
In-memory DatabasesIn-memory Databases
In-memory Databases
 
Agility and Scalability with MongoDB
Agility and Scalability with MongoDBAgility and Scalability with MongoDB
Agility and Scalability with MongoDB
 
OrigoDB - take the red pill
OrigoDB - take the red pillOrigoDB - take the red pill
OrigoDB - take the red pill
 
FlashSQL 소개 & TechTalk
FlashSQL 소개 & TechTalkFlashSQL 소개 & TechTalk
FlashSQL 소개 & TechTalk
 
Hoodie: Incremental processing on hadoop
Hoodie: Incremental processing on hadoopHoodie: Incremental processing on hadoop
Hoodie: Incremental processing on hadoop
 
CosmosDB for IoT Scenarios
CosmosDB for IoT ScenariosCosmosDB for IoT Scenarios
CosmosDB for IoT Scenarios
 
Accelerating HBase with NVMe and Bucket Cache
Accelerating HBase with NVMe and Bucket CacheAccelerating HBase with NVMe and Bucket Cache
Accelerating HBase with NVMe and Bucket Cache
 
SharePoint Saturday San Antonio: SharePoint 2010 Performance
SharePoint Saturday San Antonio: SharePoint 2010 PerformanceSharePoint Saturday San Antonio: SharePoint 2010 Performance
SharePoint Saturday San Antonio: SharePoint 2010 Performance
 
Proving out flash storage array performance using swingbench and slob
Proving out flash storage array performance using swingbench and slobProving out flash storage array performance using swingbench and slob
Proving out flash storage array performance using swingbench and slob
 
SQL Now! How Optiq brings the best of SQL to NoSQL data.
SQL Now! How Optiq brings the best of SQL to NoSQL data.SQL Now! How Optiq brings the best of SQL to NoSQL data.
SQL Now! How Optiq brings the best of SQL to NoSQL data.
 
Cosmos db
Cosmos dbCosmos db
Cosmos db
 
JavaOne_2010
JavaOne_2010JavaOne_2010
JavaOne_2010
 
DevOps for ETL processing at scale with MongoDB, Solr, AWS and Chef
DevOps for ETL processing at scale with MongoDB, Solr, AWS and ChefDevOps for ETL processing at scale with MongoDB, Solr, AWS and Chef
DevOps for ETL processing at scale with MongoDB, Solr, AWS and Chef
 
stackArmor presentation for DevOpsDC ver 4
stackArmor presentation for DevOpsDC ver 4stackArmor presentation for DevOpsDC ver 4
stackArmor presentation for DevOpsDC ver 4
 
Sharding Methods for MongoDB
Sharding Methods for MongoDBSharding Methods for MongoDB
Sharding Methods for MongoDB
 
Scality S3 Server: Node js Meetup Presentation
Scality S3 Server: Node js Meetup PresentationScality S3 Server: Node js Meetup Presentation
Scality S3 Server: Node js Meetup Presentation
 
SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...
SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...
SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...
 
ログ収集プラットフォーム開発におけるElasticsearchの運用
ログ収集プラットフォーム開発におけるElasticsearchの運用ログ収集プラットフォーム開発におけるElasticsearchの運用
ログ収集プラットフォーム開発におけるElasticsearchの運用
 
EVCache: Lowering Costs for a Low Latency Cache with RocksDB
EVCache: Lowering Costs for a Low Latency Cache with RocksDBEVCache: Lowering Costs for a Low Latency Cache with RocksDB
EVCache: Lowering Costs for a Low Latency Cache with RocksDB
 

Kürzlich hochgeladen

%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 

Kürzlich hochgeladen (20)

%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 

IMDB Showdown - OrigoDB, Redis and Hekaton

  • 2. Speed of light vs spinning metal What Time Scale L1 Cache 0.5 ns 0.008 2 m L2 Cache 7 ns 0.23 RAM 60 ns 1 240 m 1 second 1K over Gbit network 10 µs 167 2.5 minutes 4K read SSD 150 µs 2500 Rotating disk seek 10 ms 167000 40000 km 46 hours
  • 3. Price/GB vs GB/Server 1980- 2015 8 USD 6.480.000 USD 0.001 GB 2000 GB
  • 4. In-memory stores • VoltDB • MemSQL • Hazelcast • Aerospike • Memcached • Oracle Coherence • Redis • Oracle Times Ten • SQL Server In-memory OLTP • SAP Hana • OrigoDB Key/value New SQL Hybrid ?
  • 6. B-trees and Transactions LOG DATA 64KB blocks w 8x8KB pages Logical BTREE of 8kb data pages In the buffer pool (cache) Buffer Manager Transactions append inserted, deleted, original and modified pages to the LOG CHECKPOINT
  • 7. SQL Server In-memory OLTP SP Logging Latches Locks Buffer Manager I/O Native compiled SPs Minimal Logging and checkpointing Lock-free data structures Multi-version Currency control In Memory and Memory optimized data structures
  • 8. Sql Server In-memory OLTP • Heka = Greek for 100 • Transparent for application • Integrates with Sql Server but with limitations • Enterprise license • 5-30x performance gain
  • 11. • Hybrid Key/Value store • Value -> String | List | Set | Hash | SortedSet • Predefined Commands -> SET | GET | HSET | ... • Persistence: Snapshots + AOF • Highly optimized C, fast algorithms
  • 12. Twitter using redis INCR next_user_id //returns 1000 HMSET user:1000 name bart password ¤¤¤hash¤¤¤ HSET users bart 1000 ZADD followers:1000 1401267618 1234 ZADD following:1234 1401267618 1000 INCR next_post_id => 10343 HMSET post:10343 user 1000 time $time body ’Ay Caramba’ RPUSH posts:1000 10343
  • 13. 3. OrigoDB Build faster systems faster
  • 14. What’s the problem? Service Layer Domain Layer Data Access Layer Relational Model Views/SP’s Cache
  • 15. One simple idea... Keep state in memory Persist operations, not system state s0 s1 s2 op1 op2 Sn = apply(opn, Sn-1)
  • 16. ... with many names • System prevalance – Prevalyer, java • MongoDB op log • Redis AOF • Memory Image – Martin Fowler • VoltDB – logical logging • Akka persistence – logging per actor • Event Sourcing
  • 17. OrigoDB Kernel Engine Model Storage App Code Server Command Query File Sql Event Store Custom Consistency Isolation concurrency Sends commands and queries Journaling Snapshots BinaryFormatter ProtoBuf JSON tcp JSON/http In-process calls Domain specific object-graph Domain specific operations Replication Ad-hoc queries Web ui Console or win svc
  • 18. Complete history of events • Point in time • Debugging • Restore • Queries • Audit trail • New interpretations
  • 19. Example – the model [Serializable] public class CommerceModel : Model { internal SortedDictionary<Guid, Customer> Customers { get; set; } internal SortedDictionary<Guid, Order> Orders { get; set; } internal SortedDictionary<Guid, Product> Products { get; set; } public CommerceModel() { Customers = new SortedDictionary<Guid, Customer>(); Orders = new SortedDictionary<Guid, Order>(); Products = new SortedDictionary<Guid, Product>(); } }
  • 20. Command [Serializable] public class AddCustomer : Command<CommerceModel> { public readonly Guid Id; public readonly string Name; public AddCustomer(Guid id, String name) { Id = id; Name = name; } public override void Execute(CommerceModel model) { if (model.Customers.ContainsKey(Id)) Abort("Duplicate customer id"); var customer = new Customer {Id = Id, Name = Name}; model.Customers.Add(Id, customer); } }
  • 21. Query [Serializable] public class CustomerById : Query<CommerceModel, CustomerView> { public readonly Guid Id; public CustomerById(Guid id) { Id = id; } public override CustomerView Execute(CommerceModel model) { if (!model.Customers.ContainsKey(Id)) throw new Exception("no such customer"); return new CustomerView(model.Customers[Id]); } }
  • 22. Start your engines! static void Main(string[] args) { var engine = Engine.For<CommerceModel>(); Guid id = Guid.NewGuid(); var customerCommand = new AddCustomer(id, "Homer"); engine.Execute(customerCommand); var customerView = engine.Execute(new CustomerById(id)); Console.WriteLine(customerView.Name); Console.WriteLine("{0} orders", customerView.OrderIds.Count); Console.ReadLine(); }
  • 24. 4. Conclusion The old, the new and the ugly
  • 25. 100% ACID Out of the Box? SQL Server Redis OrigoDB Atomicity NO NO YES Consistency NO NO YES Isolation NO YES YES Durability YES YES YES
  • 26. Comparison Matrix SQL REDIS ORIGO License/Cost $$ OSS/Free MIT/Free (+$) Language TSQL Commands + Lua C#/LINQ OLTP YES YES YES OLAP (indexing) YES NO YES In-process NO NO YES Througput/latency 3 1 2 Modeling Relational Fixed Multi Maturity 1 2 3 Size 250GB/DB Available RAM Available RAM
  • 27. Thank you! • Try Origo! • Contribute, it’s open source • http://origodb.com • @robertfriberg, robert@devrexlabs.com

Hinweis der Redaktion

  1. Hi I’m Robert from Devrex Labs. We’re a small startup based in Sweden building OrigoDB, an in-memory database for .NET. Goals: Compare architecture, give a feel, not hands on use, you can figure that out.
  2. Why is memory so much faster? 200 meters to the convenience store down the block and back is 400 meters. 40000 km = circumference of the earth To give you some perspective... So why isn’t in-memory the default? Next slide...
  3. 99% of all OLTP databases are < 1TB – Michael Stonebraker https://aws.amazon.com/ec2/instance-types/ R3.8xlarge 32 cores, 244 GB Azure 112GB
  4. Lot’s of buzz and claims. NEW SQL Analytics, Transactions, Both or None What is a database? Key/value store? Transactions? Queries? OLAP vs. OLTP SAP HANA Column Store
  5. Let’s start with SQL Server.. RDBMS architecture conceived 70’s, implemented 80’s How do we organize data on disk to get acceptable performance for general workloads? Architected for disk access. Let’s look at how it works
  6. Logical structure of data pages. B-TREE, 8kb block, buffer pool Varje tabell är en B-TREE (om den inte är en HEAP), varje index är en b-tree Effect logging – log the effect of the transaction = modified pages, new pages Support rollback by including deleted pages and original version of modified page.
  7. Memory optimized structures – no b-trees with 8kb blocks. Linked lists of data rows Locking – rows, pages, extents. Read/write locks for data in transactions. Latches – Concurrent transactions, data structures – b-trees. Logging – No Effect logging, deleted, original, modified. Just row logging. Background process updates FILESTREAM based SP’s transcompiled to C
  8. No foreign keys No outer joins Not all datatypes supported Measure performance Compare with VoltDB – All in with in-memory. Redesigned from scratch. Command logging
  9. Show Memory Optimization Wizard for adventureworks
  10. Ok, time to look at contestant number 2. Redis is a very popular in-memory key/value where the values are complex data structures, not just simple values. Used by twitter for session data, cache (twitter, flickr,github,digg,disqus,Instagram,stackoverflow) AppFabric Cache is going away, Redis on Azure
  11. Open source Widespread Drivers for almost all languages Fast, optimized algorithms Replication Sharding
  12. Complete example with source code in PHP at http://redis.io
  13. Not faster but easier. Simplicity. Consistency. Testing.
  14. MOVING DATA BACK AND FORTH DUAL DOMAIN MODELS MAPPING COMPLEXITY ADD CACHING BECAUSE TOO SLOW, EVEN MORE PROBLEMS
  15. So let’s start off with a bit of theory. Current state of a system is a function of the initial state and the sequence of operations applied to it. Examples: Counter, increment, decrement, set, reset, read Rubiks Cube ACID – Rubiks Cube System scope can be a variable, a data structure, application or entire database. Deterministic, side effect free operations OrigoDB State is an object graph defined using NET types and collections Restore at system start by replaying commands
  16. One simple idea with many names and applications. Describe each briefly WAL – this is whats going on in your relational database. SQL Server writes to the transaction log
  17. In-memory database engine/server Code and data in same process Write-ahead command logging and snapshots Open Source single DLL for NET/Mono Commercial server with mirror replication In-memory In-memory object graph, user defined. Probably collections, entities and references. Your choice. Is it a database? Is it an object database? Linq queries. Toolkit Flexible, configurable, kernels, storage, data model, persistence modes, formatting Bring your own model. – this is key. Usually a product based on a specific data model. VoltDB, Raven Naming. LiveDomain -> LiveDB -> OrigoDB Code and data in same process Don’t do CRUD. It’s silly. ORMS are based on crud. One of the first thing you learn is don’t do SELECT *. EF Command logging The in-memory data is a projection of the commands, compare ES with a single aggregate. Same benefits as ES. What is OrigoDB? OrigoDB is an in-memory database toolkit. The core component is the Engine. The engine is 100% ACID, runs in-process and hosts a user defined data model. The data model can be domain specific or generic and is defined using plain old NET types. Persistence is based on snapshots and write-ahead command logging to the underlying storage. The Model is an instance of the user defined data model lives in RAM only is the data is a projection of the entire sequence of commands applied to the initial model, usually empty. can only be accessed through the engine The Client has no direct reference to the model interacts directly with the Engine either in-process or remote or indirectly via a proxy with the same interface as the model passes query and command objects to the engine The Engine The Engine encapsulates an instance of the model and is responsible for atomicity, consistency, isolation and durability. It performs the following tasks: writes commands to the journal executes commands and queries reads and writes snapshots restores the model on startup We call it a toolkit because you have a lot of options Modelling - define your own model or use an existing one. Generic or domain specific. It’s up to you. Storage - Default is FileStore. SqlStore or write your own module. Data format - Choose wire and storage format by plugging in different IFormatter implementations. Binary, JSON, ProtoBuf, etc Read more in the docs on Extensibility Design goals Our initial design goals were focused on rapid development, testability, simplicity, correctness, modularity, flexibility and extensibility. Performance was never a goal but running in-memory with memory optimized data structures outperforms any disk oriented system. But of course a lot of optimization is possible.
  18. OrigoDB is a cousin of Event Sourcing.. The entire database is a single aggregrate and there is single stream om events, the commands that were executed. Unless designed to partition it won’t scale out
  19. An instance of the model IS the database. Create your own domain specific model or choose a generic one. An object IS a strongly typed graph. Constraints.
  20. Guidelines No side effects or external actions – like send an email No external dependencies – like datetime.now, random Unhandled exceptions trigger rollback (full restore) Call Command.Abort() to signal exception or throw CommandAbortedException Immutable is good
  21. Serializable Inheritance Immutable Point out View and why
  22. Walk through the code Explain Engine.For<T>();
  23. Show the Geekstream site, search for ndc, ndc oslo, ode to code Show the statistics page. Show the solution explorer. Show model and a few commands, mention it’s on github.
  24. So when do you use ... OrigoDB when you can, SQL Server when you have to, REDIS if you have to. The DISEASE and THE CURE – Partners in crime, sql + cache. CQRS is a symptom of REDIS is cool and lightning fast but relatively limited representation. No querying, so often separate read models/persistence. SQL Server – existing rdbms, existing operations, policy, infrastructure, licenses OrigoDB – OLTP + OLAP Whenever data fits in RAM, can even use SQL Backing store. Auditing Debugging Projections Speed 100% ACID Testability
  25. Out of the box? Degrees, not binary. Trade-offs. Sacrifices for performance. READ_COMMITED is default isolation level. Atomic? Failures within sql transaction do not roll back unless error level > 10 isolation - > inconsistency: Phantom reads, non-repeatable reads, dirty reads