SlideShare a Scribd company logo
1 of 61
Download to read offline
OrigoDB 
Build faster systems faster
Robert Friberg 
• Design, build and maintain systems for clients at Devrex 
• Trainer – Microsoft NET, SQL Server, java, perl, python, linux 
• Machine learning, AI 
• Squash fanatic 
• @robertfriberg, robert@devrexlabs.com
Why? 
Service 
Layer 
Domain 
Layer 
Data Access 
Layer 
Relational 
Model 
Views/SP’s 
Build faster systems faster
What is OrigoDB? 
• In-memory database toolkit 
• Code and data in same process 
• Write-ahead command logging and snapshots 
• Open Source single DLL for NET/Mono 
• Commercial server with mirror replication
How does it work? 
.NET Process Storage 
Handles queries and 
commands, guards 
model 
Engine 
1. AppendToLog 
2. Execute 
command 
PlaceOrderCommand 
Snapshot 
Snapshot 
Client code 
passes commands 
and queries 
PlaceOrderCommand 
NewCustomerCommand 
IncreaseInventoryLevelCommand 
PlaceOrderCommand 
PlaceOrderCommand 
time 
In-memory 
Model
Demand drives change 
• Performance 
• Data volume 
• Scalability 
• Availability 
• Modeling 
• NoSQL 
• Big data 
• Graph 
• Real time analytics 
• In-memory computing 
• Column stores 
One size (RDBMS) no longer fits all 
Polyglot Persistence
B-trees and Transactions 
LOG 
• Fill factor 
• Page splits 
• Clustered index 
• Checkpoint 
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
When? 
• Whenever data fits in RAM 
• Alternative to general RDBMS OLAP/OLTP 
• Complex models and transactions 
• In-memory analytics 
• Traceability requirements (complete history of events)
Core framework types
Start your engines! 
var engine = Engine.LoadOrCreate<SalesModel>(); 
// lambda query 
var customer = engine.Execute(db => db.Customers.GetById(42)); 
//Command object 
var cmd = new PlaceOrderCommand(customer.Id, newOrder); 
engine.Execute(cmd); 
engine.Close();
http://geekstream.devrexlabs.com 
• 2 Core, 8GB RAM Cloud VM 
• IIS Web, SPA, ajax, ASP.NET MVC3 
• OrigoDB Server same host, currently 4GB process memory 
• 3k blogs, 500k posts, 500k keywords, 33 million links 
• Journal 1 GB, no snapshots, growth ~ 8MB/day
• Environmental news referral since 1997 
• 100 articles/day, fulltext search, summaries, categories, sources, 
metadata 
• 5000 subscribers, clients, users, billing 
• Email history, weekly newsletters 
• < 4 GB Total RAM
Modeling
Creating a data model 
• Domain specific vs. Generic vs. Hybrid 
• Rich vs. Anemic 
• Explicit vs. Implicit commands 
• References vs. Foreign keys
Computational model types 
• Interpreter hosting – Javascript, Roslyn 
• Lucene index 
• Machine learning models (Accord.NET)
Object oriented domain modeling 
• DDD? 
• Entities and collections 
• Choose collections wisely – space/time tradeoffs 
• Transaction script pattern or thin commands 
• Avoid CRUD
Silly Relational 
[Serializable] 
public class RelationalModel : Model 
{ 
private DataSet _dataset; 
public RelationalModel() 
{ 
_dataset = new DataSet(); 
} 
//... ExecuteQuery and ExecuteCommand omitted 
}
Generic Relational 
[Serializable] 
public class RelationalModel : Model 
{ 
Dictionary<string,SortedDictionary<object>> _tables; 
}
Domain specific relational 
[Serializable] 
public class Model : Model 
{ 
SortedDictionary<int,Customer> _customers; 
SortedDictionary<int,Order> _orders; 
SortedDictionary<int,Product> _products; 
SortedDictionary<string,Customer> _customersByName; 
} 
[Serializable] 
public class Order { 
public int CustomerId; //foreign key vs. reference 
}
JS interpreter hosting (V8) 
[Serializable] 
public class JurassicModel : Model 
{ 
private ScriptEngine _scriptEngine; 
public JurassicModel() 
{ 
_scriptEngine = new ScriptEngine(); 
_scriptEngine.Execute("var model = {}"); 
} 
//... ExecuteQuery and ExecuteCommand omitted 
}
Commands 
• Serial execution 
• Exclusive access to the model 
• Transition the model from one valid state to the next 
s0 t s1 s2 1 t2
Command guidelines 
• No side effects or external actions 
• No external dependencies 
• Unhandled exceptions trigger rollback (full restore) 
• Call Command.Abort() to signal exception
The model is an object graph 
TaskList 
Task 
Task 
Task 
TaskList 
Task 
Task 
Task 
Task 
Category 
Category 
Category 
Category 
TaskModel
Query alternatives 
• Ad-hoc lambda: Engine.Execute(Func<M,R> query) 
• Derive from Query<M,R> 
• Compiled LINQ: Engine.Execute<R>(string, args)
Query guidelines 
• Know thy object graphs 
• Don’t modify the model
Demo: HockeySkolan 
• ASP.NET MVC 3 with backing OrigoDB 
• Domain specific model + CmsModel 
• Anemic model => fat commands, model is data
OrigoDB Workshop 
Module 3 - Testing
Automated Test alternatives 
• Transparent testing of domain behavior: entities, model 
• Test commands, queries, entities on model without engine 
• Test with in-memory storage 
• Full stack testing – slow, requires cleanup
In-memory storage 
• Non persistent command journal and snapshots 
• Mimics FileStore using MemoryStreams 
• Tests serialization/identity issues 
var config = EngineConfiguration.Create().ForIsolatedTest(); 
OR: 
config.SetCommandStoreFactory(cfg => new InMemoryCommandStore(cfg)); 
config.SetSnapshotStoreFactory(cfg => new InMemorySnapshotStore(cfg));
Demo: RedisModel 
• Testing model behavior with NUnit
OrigoDB Workshop 
Module 4 – Hosting
Direct in-process engine creation 
• Static Engine methods 
• Create() 
• LoadOrCreate() 
• Load() 
• Returns: Engine, Engine<M> 
Engine<MyModel> engine = Engine.LoadOrCreate<MyModel>();
Engine.For<M>() 
• Returns IEngine<M>() or derivative 
• Reuse based on EngineConfiguration.Location property 
• Remote or in-process 
• ILocalEngineClient<M> 
• IRemoteEngineClient<M> 
• Running engines are tracked by Config.Engines
Db.For<M>() 
• Returns a proxy for M 
• Remote or Local analogous to Engine.For<M>
x64 vs. x32 
• Core Library compiled with AnyCPU 
• x32 = 32-bit pointers, max 4GB 
• x64 = 64-bit pointers 
• Server ships with x64 and x32 binaries
IIS Hosting 
• Disable application pool recycling 
• Ensure single process, no farming or LB 
• Litter controllers with Db.For<M>() / Engine.For<M>() 
• Or put a static ref somewhere, eg Global.asax
Proxy 
• Proxy has same interface as the Model 
• Method calls are intercepted 
• void methods interpreted as commands (and logged) 
• other methods interpreted as queries 
• Can be overriden with attributes 
• Local or remote, cluster
Demo: Let’s build a key/value store 
• New project 
• Reference origodb.core 
• Define KeyValueStoreModel 
• void Put(key, value) 
• object Get(key,value) 
• bool Exists(key, value) 
• bool Remove(key,value) 
• Add some unit tests
OrigoDB Workshop 
Module 5 – Configuration
EngineConfiguration class – key properties 
• AsyncJournaling 
• EnsureSafeResults 
• Kernel 
• Location 
• PacketOptions 
• PersistenceMode 
• SnapshotBehavior
EngineConfiguration.Location property 
• File location for FileStorage 
• Connection string when SqlStorage 
• Defaults (when null) 
• Will look in app.config for connection string 
• Type name of model 
• Current working directory 
• App_Data in web context 
• Magic 
• mode=remote;host=10.0.0.20;port=3001
Persistence modes 
• Journaling (default) 
• SnapshotPerTransaction 
• ManualSnapshots 
var config = EngineConfiguration.Create(); 
config.PersistenceMode = PersistenceMode.SnapshotPerTransaction; 
var db = Engine.For<MyModel>(config);
Kernels 
• OptimisticKernel (default) 
• RoyalFoodTaster 
var config = EngineConfiguration.Create(); 
config.Kernel = Kernels.RoyalFoodTaster; 
var db = Db.For<MyModel>(config);
Logging 
• Logging disabled by default 
//enable logging 
ConsoleLogger.MinimumLevel = LogLevel.Trace; 
//Plugin custom logger 
LogProvider.SetFactory(new Log4NetLoggerFactory());
Extensibility 
• EngineConfiguration methods 
• SetAuthorizerFactory() 
• SetSynchronizerFactory() 
• SetCommandStoreFactory() 
• SetFormatterFactory()
ProtobufFormatter 
• Protocol Buffers by Google 
• IFormatter wrapper around protobuf-net by @marcgravell 
• Contract based as opposed to embedded metadata 
• Compact, fast, loose coupling, cross platform 
• Configure with attributes or code 
• Use it!
Protobuf: Attribute based configuration 
[ProtoContract] 
public class Company 
{ 
[ProtoMember(1)] 
public string Name { get; set; } 
[ProtoMember(2)] 
public List<Employee> Employees { get; set; } 
}
Protobuf: Code-based configuration 
var typeModel = TypeModel.Create(); 
typeModel.Add(typeof (Company), false) 
.Add(1, ”Name") 
.Add(2, ”Employees");
Inject formatter factory 
//use helper methods 
ProtoBufFormatter.ConfigureSnapshots<MyModel>(config, typeModel); 
ProtoBufFormatter.Configure(config, FormatterUsage.Results, typeModel); 
//or do it yourself 
config.SetFormatterFactory((cfg,fu) 
=> new ProtoBufFormatter<MyModel>(typeModel), 
FormatterUsage.Snapshot);
OrigoDB Workshop 
Module 6 – Immutability
Immutability and blocking writer 
reader
States share immutable objects 
s0 
s2 
s s3 1 
(Animated slide)
Example 
immutable 
model
Example 
immutable 
entity
Immutable command example
Configuration
OrigoDB Workshop 
Module 6 – Server
OrigoDB Server 
• Console Application or Windows Service 
• Process hosting single Engine / Model 
• Ad-hoc Linq / Razor queries 
• Javascript API 
• Primitive web based UI 
• Commercial License 
• Multiserver replication
Transparent client migration 
• Configuration strings: 
• mode=embedded 
• mode=remote;host=10.10.10.10;port=3001
Lab M6 
• Follow the OrigoDB Server online tutorial 
http://origodb.com/
Thank you for listening! 
• http://origodb.com 
• http://dev.origodb.com 
• http://github.com/devrexlabs 
• http://geekstream.devrexlabs.com 
• @robertfriberg, @devrexlabs

More Related Content

What's hot

NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryAlexandre Morgaut
 
Evolution of MonogDB Sharding and Its Best Practices - Ranjith A - Mydbops Team
Evolution of MonogDB Sharding and Its Best Practices - Ranjith A - Mydbops TeamEvolution of MonogDB Sharding and Its Best Practices - Ranjith A - Mydbops Team
Evolution of MonogDB Sharding and Its Best Practices - Ranjith A - Mydbops TeamMydbops
 
Benchx: An XQuery benchmarking web application
Benchx: An XQuery benchmarking web application Benchx: An XQuery benchmarking web application
Benchx: An XQuery benchmarking web application Andy Bunce
 
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsMongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsSpringPeople
 
Rapid prototyping using azure functions - A walk on the wild side
Rapid prototyping using azure functions - A walk on the wild sideRapid prototyping using azure functions - A walk on the wild side
Rapid prototyping using azure functions - A walk on the wild sideSamrat Saha
 
Working with MongoDB as MySQL DBA
Working with MongoDB as MySQL DBAWorking with MongoDB as MySQL DBA
Working with MongoDB as MySQL DBAIgor Donchovski
 
Lecture 40 1
Lecture 40 1Lecture 40 1
Lecture 40 1patib5
 
YoctoDB в Яндекс.Вертикалях
YoctoDB в Яндекс.ВертикаляхYoctoDB в Яндекс.Вертикалях
YoctoDB в Яндекс.ВертикаляхCEE-SEC(R)
 
Putting the Go in MongoDB: How We Rebuilt The MongoDB Tools in Go
Putting the Go in MongoDB: How We Rebuilt The MongoDB Tools in GoPutting the Go in MongoDB: How We Rebuilt The MongoDB Tools in Go
Putting the Go in MongoDB: How We Rebuilt The MongoDB Tools in GoMongoDB
 
MongoDB basics & Introduction
MongoDB basics & IntroductionMongoDB basics & Introduction
MongoDB basics & IntroductionJerwin Roy
 
Using NoSQL MongoDB with ColdFusion
Using NoSQL MongoDB with ColdFusionUsing NoSQL MongoDB with ColdFusion
Using NoSQL MongoDB with ColdFusionindiver
 
Microsoft Hekaton
Microsoft HekatonMicrosoft Hekaton
Microsoft HekatonSiraj Memon
 
CBDW2014 - NoSQL Development With Couchbase and ColdFusion (CFML)
CBDW2014 - NoSQL Development With Couchbase and ColdFusion (CFML)CBDW2014 - NoSQL Development With Couchbase and ColdFusion (CFML)
CBDW2014 - NoSQL Development With Couchbase and ColdFusion (CFML)Ortus Solutions, Corp
 
FITC presents: Mobile & offline data synchronization in Angular JS
FITC presents: Mobile & offline data synchronization in Angular JSFITC presents: Mobile & offline data synchronization in Angular JS
FITC presents: Mobile & offline data synchronization in Angular JSFITC
 
BaseX user-group-talk XML Prague 2013
BaseX user-group-talk XML Prague 2013BaseX user-group-talk XML Prague 2013
BaseX user-group-talk XML Prague 2013Andy Bunce
 
MongoDB Command Line Tools
MongoDB Command Line ToolsMongoDB Command Line Tools
MongoDB Command Line ToolsRainforest QA
 
MongoDB's New Aggregation framework
MongoDB's New Aggregation frameworkMongoDB's New Aggregation framework
MongoDB's New Aggregation frameworkChris Westin
 

What's hot (20)

Lokijs
LokijsLokijs
Lokijs
 
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love Story
 
Evolution of MonogDB Sharding and Its Best Practices - Ranjith A - Mydbops Team
Evolution of MonogDB Sharding and Its Best Practices - Ranjith A - Mydbops TeamEvolution of MonogDB Sharding and Its Best Practices - Ranjith A - Mydbops Team
Evolution of MonogDB Sharding and Its Best Practices - Ranjith A - Mydbops Team
 
Benchx: An XQuery benchmarking web application
Benchx: An XQuery benchmarking web application Benchx: An XQuery benchmarking web application
Benchx: An XQuery benchmarking web application
 
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsMongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
 
Rapid prototyping using azure functions - A walk on the wild side
Rapid prototyping using azure functions - A walk on the wild sideRapid prototyping using azure functions - A walk on the wild side
Rapid prototyping using azure functions - A walk on the wild side
 
Working with MongoDB as MySQL DBA
Working with MongoDB as MySQL DBAWorking with MongoDB as MySQL DBA
Working with MongoDB as MySQL DBA
 
Lecture 40 1
Lecture 40 1Lecture 40 1
Lecture 40 1
 
YoctoDB в Яндекс.Вертикалях
YoctoDB в Яндекс.ВертикаляхYoctoDB в Яндекс.Вертикалях
YoctoDB в Яндекс.Вертикалях
 
Putting the Go in MongoDB: How We Rebuilt The MongoDB Tools in Go
Putting the Go in MongoDB: How We Rebuilt The MongoDB Tools in GoPutting the Go in MongoDB: How We Rebuilt The MongoDB Tools in Go
Putting the Go in MongoDB: How We Rebuilt The MongoDB Tools in Go
 
MongoDB basics & Introduction
MongoDB basics & IntroductionMongoDB basics & Introduction
MongoDB basics & Introduction
 
Using NoSQL MongoDB with ColdFusion
Using NoSQL MongoDB with ColdFusionUsing NoSQL MongoDB with ColdFusion
Using NoSQL MongoDB with ColdFusion
 
Microsoft Hekaton
Microsoft HekatonMicrosoft Hekaton
Microsoft Hekaton
 
CBDW2014 - NoSQL Development With Couchbase and ColdFusion (CFML)
CBDW2014 - NoSQL Development With Couchbase and ColdFusion (CFML)CBDW2014 - NoSQL Development With Couchbase and ColdFusion (CFML)
CBDW2014 - NoSQL Development With Couchbase and ColdFusion (CFML)
 
FITC presents: Mobile & offline data synchronization in Angular JS
FITC presents: Mobile & offline data synchronization in Angular JSFITC presents: Mobile & offline data synchronization in Angular JS
FITC presents: Mobile & offline data synchronization in Angular JS
 
BaseX user-group-talk XML Prague 2013
BaseX user-group-talk XML Prague 2013BaseX user-group-talk XML Prague 2013
BaseX user-group-talk XML Prague 2013
 
MongoDB Command Line Tools
MongoDB Command Line ToolsMongoDB Command Line Tools
MongoDB Command Line Tools
 
MongoDB's New Aggregation framework
MongoDB's New Aggregation frameworkMongoDB's New Aggregation framework
MongoDB's New Aggregation framework
 
Mongo DB
Mongo DB Mongo DB
Mongo DB
 
Mashing the data
Mashing the dataMashing the data
Mashing the data
 

Similar to OrigoDB - take the red pill

How to generate customized java 8 code from your database
How to generate customized java 8 code from your databaseHow to generate customized java 8 code from your database
How to generate customized java 8 code from your databaseSpeedment, Inc.
 
Silicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your databaseSilicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your databaseSpeedment, Inc.
 
Running Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on HadoopRunning Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on Hadoopclairvoyantllc
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...Malin Weiss
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...Speedment, Inc.
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and ActivatorKevin Webber
 
Architectures, Frameworks and Infrastructure
Architectures, Frameworks and InfrastructureArchitectures, Frameworks and Infrastructure
Architectures, Frameworks and Infrastructureharendra_pathak
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development SecuritySam Bowne
 
Sista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performanceSista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performanceESUG
 
CISSP Prep: Ch 9. Software Development Security
CISSP Prep: Ch 9. Software Development SecurityCISSP Prep: Ch 9. Software Development Security
CISSP Prep: Ch 9. Software Development SecuritySam Bowne
 
Bye bye $GLOBALS['TYPO3_DB']
Bye bye $GLOBALS['TYPO3_DB']Bye bye $GLOBALS['TYPO3_DB']
Bye bye $GLOBALS['TYPO3_DB']Jan Helke
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development SecuritySam Bowne
 
Adding Support for Networking and Web Technologies to an Embedded System
Adding Support for Networking and Web Technologies to an Embedded SystemAdding Support for Networking and Web Technologies to an Embedded System
Adding Support for Networking and Web Technologies to an Embedded SystemJohn Efstathiades
 
Predicting Flights with Azure Databricks
Predicting Flights with Azure DatabricksPredicting Flights with Azure Databricks
Predicting Flights with Azure DatabricksSarah Dutkiewicz
 
Asp.net MVC training session
Asp.net MVC training sessionAsp.net MVC training session
Asp.net MVC training sessionHrichi Mohamed
 
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvpZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvpChalermpon Areepong
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disquszeeg
 

Similar to OrigoDB - take the red pill (20)

How to generate customized java 8 code from your database
How to generate customized java 8 code from your databaseHow to generate customized java 8 code from your database
How to generate customized java 8 code from your database
 
Silicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your databaseSilicon Valley JUG - How to generate customized java 8 code from your database
Silicon Valley JUG - How to generate customized java 8 code from your database
 
Running Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on HadoopRunning Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on Hadoop
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and Activator
 
In-memory Databases
In-memory DatabasesIn-memory Databases
In-memory Databases
 
Architectures, Frameworks and Infrastructure
Architectures, Frameworks and InfrastructureArchitectures, Frameworks and Infrastructure
Architectures, Frameworks and Infrastructure
 
mtl_rubykaigi
mtl_rubykaigimtl_rubykaigi
mtl_rubykaigi
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development Security
 
Sista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performanceSista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performance
 
CISSP Prep: Ch 9. Software Development Security
CISSP Prep: Ch 9. Software Development SecurityCISSP Prep: Ch 9. Software Development Security
CISSP Prep: Ch 9. Software Development Security
 
Bye bye $GLOBALS['TYPO3_DB']
Bye bye $GLOBALS['TYPO3_DB']Bye bye $GLOBALS['TYPO3_DB']
Bye bye $GLOBALS['TYPO3_DB']
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development Security
 
Adding Support for Networking and Web Technologies to an Embedded System
Adding Support for Networking and Web Technologies to an Embedded SystemAdding Support for Networking and Web Technologies to an Embedded System
Adding Support for Networking and Web Technologies to an Embedded System
 
Predicting Flights with Azure Databricks
Predicting Flights with Azure DatabricksPredicting Flights with Azure Databricks
Predicting Flights with Azure Databricks
 
Asp.net MVC training session
Asp.net MVC training sessionAsp.net MVC training session
Asp.net MVC training session
 
Asp.Net MVC
Asp.Net MVCAsp.Net MVC
Asp.Net MVC
 
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvpZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
 
DjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling DisqusDjangoCon 2010 Scaling Disqus
DjangoCon 2010 Scaling Disqus
 

Recently uploaded

Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilVICTOR MAESTRE RAMIREZ
 
JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIIvo Andreev
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadIvo Andreev
 
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.Sharon Liu
 
eAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionseAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionsNirav Modi
 
Kawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies
 
online pdf editor software solutions.pdf
online pdf editor software solutions.pdfonline pdf editor software solutions.pdf
online pdf editor software solutions.pdfMeon Technology
 
Top Software Development Trends in 2024
Top Software Development Trends in  2024Top Software Development Trends in  2024
Top Software Development Trends in 2024Mind IT Systems
 
Sales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales CoverageSales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales CoverageDista
 
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine HarmonyLeveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmonyelliciumsolutionspun
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampVICTOR MAESTRE RAMIREZ
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLAlluxio, Inc.
 
AI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyAI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyRaymond Okyere-Forson
 
Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesSoftwareMill
 
Why Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfWhy Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfBrain Inventory
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeNeo4j
 
Streamlining Your Application Builds with Cloud Native Buildpacks
Streamlining Your Application Builds  with Cloud Native BuildpacksStreamlining Your Application Builds  with Cloud Native Buildpacks
Streamlining Your Application Builds with Cloud Native BuildpacksVish Abrams
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Incrobinwilliams8624
 
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsJaydeep Chhasatia
 

Recently uploaded (20)

Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-Council
 
JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AI
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and Bad
 
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.
20240319 Car Simulator Plan.pptx . Plan for a JavaScript Car Driving Simulator.
 
eAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionseAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspections
 
Kawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in Trivandrum
 
online pdf editor software solutions.pdf
online pdf editor software solutions.pdfonline pdf editor software solutions.pdf
online pdf editor software solutions.pdf
 
Top Software Development Trends in 2024
Top Software Development Trends in  2024Top Software Development Trends in  2024
Top Software Development Trends in 2024
 
Salesforce AI Associate Certification.pptx
Salesforce AI Associate Certification.pptxSalesforce AI Associate Certification.pptx
Salesforce AI Associate Certification.pptx
 
Sales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales CoverageSales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales Coverage
 
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine HarmonyLeveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - Datacamp
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
 
AI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human BeautyAI Embracing Every Shade of Human Beauty
AI Embracing Every Shade of Human Beauty
 
Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retries
 
Why Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfWhy Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdf
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG time
 
Streamlining Your Application Builds with Cloud Native Buildpacks
Streamlining Your Application Builds  with Cloud Native BuildpacksStreamlining Your Application Builds  with Cloud Native Buildpacks
Streamlining Your Application Builds with Cloud Native Buildpacks
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Inc
 
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
 

OrigoDB - take the red pill

  • 1. OrigoDB Build faster systems faster
  • 2. Robert Friberg • Design, build and maintain systems for clients at Devrex • Trainer – Microsoft NET, SQL Server, java, perl, python, linux • Machine learning, AI • Squash fanatic • @robertfriberg, robert@devrexlabs.com
  • 3. Why? Service Layer Domain Layer Data Access Layer Relational Model Views/SP’s Build faster systems faster
  • 4. What is OrigoDB? • In-memory database toolkit • Code and data in same process • Write-ahead command logging and snapshots • Open Source single DLL for NET/Mono • Commercial server with mirror replication
  • 5. How does it work? .NET Process Storage Handles queries and commands, guards model Engine 1. AppendToLog 2. Execute command PlaceOrderCommand Snapshot Snapshot Client code passes commands and queries PlaceOrderCommand NewCustomerCommand IncreaseInventoryLevelCommand PlaceOrderCommand PlaceOrderCommand time In-memory Model
  • 6. Demand drives change • Performance • Data volume • Scalability • Availability • Modeling • NoSQL • Big data • Graph • Real time analytics • In-memory computing • Column stores One size (RDBMS) no longer fits all Polyglot Persistence
  • 7. B-trees and Transactions LOG • Fill factor • Page splits • Clustered index • Checkpoint 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
  • 8. When? • Whenever data fits in RAM • Alternative to general RDBMS OLAP/OLTP • Complex models and transactions • In-memory analytics • Traceability requirements (complete history of events)
  • 10. Start your engines! var engine = Engine.LoadOrCreate<SalesModel>(); // lambda query var customer = engine.Execute(db => db.Customers.GetById(42)); //Command object var cmd = new PlaceOrderCommand(customer.Id, newOrder); engine.Execute(cmd); engine.Close();
  • 11. http://geekstream.devrexlabs.com • 2 Core, 8GB RAM Cloud VM • IIS Web, SPA, ajax, ASP.NET MVC3 • OrigoDB Server same host, currently 4GB process memory • 3k blogs, 500k posts, 500k keywords, 33 million links • Journal 1 GB, no snapshots, growth ~ 8MB/day
  • 12. • Environmental news referral since 1997 • 100 articles/day, fulltext search, summaries, categories, sources, metadata • 5000 subscribers, clients, users, billing • Email history, weekly newsletters • < 4 GB Total RAM
  • 14. Creating a data model • Domain specific vs. Generic vs. Hybrid • Rich vs. Anemic • Explicit vs. Implicit commands • References vs. Foreign keys
  • 15. Computational model types • Interpreter hosting – Javascript, Roslyn • Lucene index • Machine learning models (Accord.NET)
  • 16. Object oriented domain modeling • DDD? • Entities and collections • Choose collections wisely – space/time tradeoffs • Transaction script pattern or thin commands • Avoid CRUD
  • 17. Silly Relational [Serializable] public class RelationalModel : Model { private DataSet _dataset; public RelationalModel() { _dataset = new DataSet(); } //... ExecuteQuery and ExecuteCommand omitted }
  • 18. Generic Relational [Serializable] public class RelationalModel : Model { Dictionary<string,SortedDictionary<object>> _tables; }
  • 19. Domain specific relational [Serializable] public class Model : Model { SortedDictionary<int,Customer> _customers; SortedDictionary<int,Order> _orders; SortedDictionary<int,Product> _products; SortedDictionary<string,Customer> _customersByName; } [Serializable] public class Order { public int CustomerId; //foreign key vs. reference }
  • 20. JS interpreter hosting (V8) [Serializable] public class JurassicModel : Model { private ScriptEngine _scriptEngine; public JurassicModel() { _scriptEngine = new ScriptEngine(); _scriptEngine.Execute("var model = {}"); } //... ExecuteQuery and ExecuteCommand omitted }
  • 21. Commands • Serial execution • Exclusive access to the model • Transition the model from one valid state to the next s0 t s1 s2 1 t2
  • 22. Command guidelines • No side effects or external actions • No external dependencies • Unhandled exceptions trigger rollback (full restore) • Call Command.Abort() to signal exception
  • 23. The model is an object graph TaskList Task Task Task TaskList Task Task Task Task Category Category Category Category TaskModel
  • 24. Query alternatives • Ad-hoc lambda: Engine.Execute(Func<M,R> query) • Derive from Query<M,R> • Compiled LINQ: Engine.Execute<R>(string, args)
  • 25. Query guidelines • Know thy object graphs • Don’t modify the model
  • 26. Demo: HockeySkolan • ASP.NET MVC 3 with backing OrigoDB • Domain specific model + CmsModel • Anemic model => fat commands, model is data
  • 27. OrigoDB Workshop Module 3 - Testing
  • 28. Automated Test alternatives • Transparent testing of domain behavior: entities, model • Test commands, queries, entities on model without engine • Test with in-memory storage • Full stack testing – slow, requires cleanup
  • 29. In-memory storage • Non persistent command journal and snapshots • Mimics FileStore using MemoryStreams • Tests serialization/identity issues var config = EngineConfiguration.Create().ForIsolatedTest(); OR: config.SetCommandStoreFactory(cfg => new InMemoryCommandStore(cfg)); config.SetSnapshotStoreFactory(cfg => new InMemorySnapshotStore(cfg));
  • 30. Demo: RedisModel • Testing model behavior with NUnit
  • 31. OrigoDB Workshop Module 4 – Hosting
  • 32. Direct in-process engine creation • Static Engine methods • Create() • LoadOrCreate() • Load() • Returns: Engine, Engine<M> Engine<MyModel> engine = Engine.LoadOrCreate<MyModel>();
  • 33. Engine.For<M>() • Returns IEngine<M>() or derivative • Reuse based on EngineConfiguration.Location property • Remote or in-process • ILocalEngineClient<M> • IRemoteEngineClient<M> • Running engines are tracked by Config.Engines
  • 34. Db.For<M>() • Returns a proxy for M • Remote or Local analogous to Engine.For<M>
  • 35. x64 vs. x32 • Core Library compiled with AnyCPU • x32 = 32-bit pointers, max 4GB • x64 = 64-bit pointers • Server ships with x64 and x32 binaries
  • 36. IIS Hosting • Disable application pool recycling • Ensure single process, no farming or LB • Litter controllers with Db.For<M>() / Engine.For<M>() • Or put a static ref somewhere, eg Global.asax
  • 37. Proxy • Proxy has same interface as the Model • Method calls are intercepted • void methods interpreted as commands (and logged) • other methods interpreted as queries • Can be overriden with attributes • Local or remote, cluster
  • 38. Demo: Let’s build a key/value store • New project • Reference origodb.core • Define KeyValueStoreModel • void Put(key, value) • object Get(key,value) • bool Exists(key, value) • bool Remove(key,value) • Add some unit tests
  • 39. OrigoDB Workshop Module 5 – Configuration
  • 40. EngineConfiguration class – key properties • AsyncJournaling • EnsureSafeResults • Kernel • Location • PacketOptions • PersistenceMode • SnapshotBehavior
  • 41. EngineConfiguration.Location property • File location for FileStorage • Connection string when SqlStorage • Defaults (when null) • Will look in app.config for connection string • Type name of model • Current working directory • App_Data in web context • Magic • mode=remote;host=10.0.0.20;port=3001
  • 42. Persistence modes • Journaling (default) • SnapshotPerTransaction • ManualSnapshots var config = EngineConfiguration.Create(); config.PersistenceMode = PersistenceMode.SnapshotPerTransaction; var db = Engine.For<MyModel>(config);
  • 43. Kernels • OptimisticKernel (default) • RoyalFoodTaster var config = EngineConfiguration.Create(); config.Kernel = Kernels.RoyalFoodTaster; var db = Db.For<MyModel>(config);
  • 44. Logging • Logging disabled by default //enable logging ConsoleLogger.MinimumLevel = LogLevel.Trace; //Plugin custom logger LogProvider.SetFactory(new Log4NetLoggerFactory());
  • 45. Extensibility • EngineConfiguration methods • SetAuthorizerFactory() • SetSynchronizerFactory() • SetCommandStoreFactory() • SetFormatterFactory()
  • 46. ProtobufFormatter • Protocol Buffers by Google • IFormatter wrapper around protobuf-net by @marcgravell • Contract based as opposed to embedded metadata • Compact, fast, loose coupling, cross platform • Configure with attributes or code • Use it!
  • 47. Protobuf: Attribute based configuration [ProtoContract] public class Company { [ProtoMember(1)] public string Name { get; set; } [ProtoMember(2)] public List<Employee> Employees { get; set; } }
  • 48. Protobuf: Code-based configuration var typeModel = TypeModel.Create(); typeModel.Add(typeof (Company), false) .Add(1, ”Name") .Add(2, ”Employees");
  • 49. Inject formatter factory //use helper methods ProtoBufFormatter.ConfigureSnapshots<MyModel>(config, typeModel); ProtoBufFormatter.Configure(config, FormatterUsage.Results, typeModel); //or do it yourself config.SetFormatterFactory((cfg,fu) => new ProtoBufFormatter<MyModel>(typeModel), FormatterUsage.Snapshot);
  • 50. OrigoDB Workshop Module 6 – Immutability
  • 51. Immutability and blocking writer reader
  • 52. States share immutable objects s0 s2 s s3 1 (Animated slide)
  • 57. OrigoDB Workshop Module 6 – Server
  • 58. OrigoDB Server • Console Application or Windows Service • Process hosting single Engine / Model • Ad-hoc Linq / Razor queries • Javascript API • Primitive web based UI • Commercial License • Multiserver replication
  • 59. Transparent client migration • Configuration strings: • mode=embedded • mode=remote;host=10.10.10.10;port=3001
  • 60. Lab M6 • Follow the OrigoDB Server online tutorial http://origodb.com/
  • 61. Thank you for listening! • http://origodb.com • http://dev.origodb.com • http://github.com/devrexlabs • http://geekstream.devrexlabs.com • @robertfriberg, @devrexlabs

Editor's Notes

  1. What is it? How does it work? Who built it and why? When does it shine? When does it suck?
  2. What if we just keep all the data in RAM? Moving back and forth and mapping is silly. Code and data in same process. Productivity Simplicity Consistency Testability Strongly typed, compile time checked Operations
  3. Capturing the essence.. 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. Requires NET 4.0
  4. 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.
  5. Performance –> in-memory, specialization Data volume -> sharding, partitioning Availability -> redundancy Mångfald, det händer saker.
  6. Fi B-TREE, 8kb block, buffer pool, animering av en transaktion. Column stores 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. Simplicity and all that comes with it. 40% less code. Reason enough. Low latency queries, heavy load querying With event sourcing, polyglot persistence. Build a read model from an event stream Complex domain models: Because a trivial model is trivial to ORM, RDBMS. Difficult to model relationally
  8. An in-memory instance of the Model is the data. Commands are like Stored Procedures Queries are like Views Ad-hoc LINQ
  9. A quick example
  10. Show the web site, search, show about, mention github, show some code
  11. approx 500’ articles
  12. Not necessarily data
  13. Sole purpose is to update the state of the model, from one state to another. Avoid embedding entities and graphs, regard commands as simple messages.
  14. Lambdas won’t serialize – local process only
  15. Results get cloned unless otherwise specified.
  16. Show the model, the entities, the commands. Queries/lambdas in controllers. Show hosting in global.asax
  17. Describe the In-memory store and config for isolated test Depends on where the logic is, commands or model or both Test with storage exercises serialization, use to ensure serialization and isolation Full stack as smoke tests and to verify configuration or framework related behavior
  18. Considerations when hosting the in-process engine and model. Lifecycle
  19. Snapshots, direct interaction, Dispose, plenty of overloads taking config, config-string, initial model
  20. Abstraction for convenience
  21. Thread safe execute overloads
  22. Or – demonstrate geeksream
  23. Considerations when hosting the in-process engine and model. Lifecycle
  24. Explain each briefly
  25. Pretty messy, leaky abstractions, needs redesign. Any takers?
  26. Authorizer uses IPrincical and Roles of current thread identity. Synchronizer unimportant, ReaderWriterLockSlim default SqlStorage, EventStoreStore, Azure TableStorage for snapshots BinaryFormatter, JsonFormatter, ProtobufFormatter
  27. Compare with BinaryFormatter, Reflection Use it: In production, let the design stabilize first
  28. Considerations when hosting the in-process engine and model. Lifecycle
  29. Write transactions are serialized without blocking readers. Reader gets the most recent state.
  30. This is an animated slide
  31. _tasks.ToArray() creates a new array, thus no way to modify the _tasks array. AddTask() returns a new TodoModel instance, thus it is immutable Strings are immutable. The strings are shared among consecutive instances of TodoModel
  32. Could have had an IsCompleted() method and assert !IsCompleted() in the Complete method. But the point is that instances of Task are immutable.
  33. Notice base class and out parameter on execute
  34. Considerations when hosting the in-process engine and model. Lifecycle