Сергей Калинец "Не SQL-ом единым..."
-
Upload
fwdays -
Category
Technology
-
view
243 -
download
2
Transcript of Сергей Калинец "Не SQL-ом единым..."
@skalinets 7
Why PainToo much configuration
Leaking abstractions
Object model does not fit business model
Things become complicated very fast
@skalinets 10
Micro ORMs: the best from both worldsHandcraft SQL for queries
Handles mapping for you
Require less code (and provide less functionality)
@skalinets 12
PetaPocoFast like Dapper
Works with strictly undecorated POCOs, or attributed almost-POCOs
Built-in paging
SqlBuilder helps create SQL
@skalinets 13
Get datavar article1 = db.Single<Article>(123);
var article2 = db.Single<Article>("WHERE ArticleKey = @0", "ART-
123");
@skalinets 14
Modify datavar a = new article();a.title = "My new article";...db.Insert(a);
// Update ita.content = "Blah blah";db.Update(a);
// Delete itdb.Delete(a);
@skalinets 15
Or this way..
db.Delete<article>("WHERE article_id=@0", 123);
db.Update<article>("SET title=@0 WHERE
article_id=@1", "New Title", 123);
@skalinets 18
Problems with SQLIt’s kind of old school
Object relational impedance mismatch
Poor scaling out
Schema first
@skalinets 19
NoSQLLot of options
NoSQL == no schema-first
Easy scale / deployment
Something new to give a try…
@skalinets 20
NoSQL typesDocument
Key-value storage
Column Family
Graph
http://nosql-database.org/ lists over 255 DBs
@skalinets 22
But still…Most approaches store only the current view
Changing things retrospectively == PAIN
@skalinets 24
ES ConceptsEvent is something that has happened
Event can always be applied (no validation needed)
Events are persisted in event store
Events are available via streams
@skalinets 25
How it worksChanges in domain trigger events
Entities (aggregates) accept events to update it’s state
Views (projections) accept events to get updated as well
@skalinets 28
BenefitsSimple storage for events
Endless choices for projections
Projections can be changed at any time
Maximum data is stored compared to other models
@skalinets 29
d60 CirqusSimple but powerful event sourcing + CQRS kit
Fluent configuration
Support for multiple storages (MS SQL, Azure Service Bus, Entity Framework)
@skalinets 30
Cirqus FocusRaw performance Polished APIs and general usefulness=========================(+)=============
Complex event processing Domain-model-centric event processing==========================(+)============
.NET-centric Interoperable==========(+)============================
@skalinets 32
But…SQL (and MS SQL) are still in the game
There are more than one approaches to SQL handling
There are more than one approaches to data storage
@skalinets 34
Resourceshttp://www.toptensoftware.com/petapoco/https://github.com/StackExchange/dapper-dot-nethttps://msdn.microsoft.com/en-us/library/dn589792.aspx (ES)http://neventstore.orghttps://github.com/d60/Cirqus