applied with Marten
Tim Cools ( @timcoolsnet )
A | 750 € |
---|
B | 1500 € |
---|
750 €
-500 €
1000 €
+500 €
A | 250 € |
---|
B | 1000 € |
---|
single transaction
commit
A | 750 € |
---|
B | 1500 € |
---|
750
-500
1000
+500
A | 250 € |
---|
B | 1000 € |
---|
750
-350
C | 2350 € |
---|
C | 2350 € |
---|
+350
2000
A | 400 € |
---|
concurrent transactions - serialization non-lock
commit
commit
FAILED
Transaction
Write Transaction Log
Commit
Update buffer
Transaction Log |
---|
INSERT |
UPDATE |
Data Page | |
---|---|
A | ... |
B | ... |
C | ... |
File
File
Sync
Async
Index |
---|
... |
... |
And many more...
C
A
P
C
A
RDBMS
Single-node
NoSql
C
P
MongoDB
BigTable
Redis
MemcachedDB
A
P
Cassandra
Riak
CouchDB
SimpleDB
public class Route
{
private readonly List<Stop> _stops = new List<Stop>();
public Guid Id { get; private set; }
public RouteStatus Status { get; private set; }
public DateTime? Date { get; private set; }
public IEnumerable Stops => _stops;
public void Plan(DateTime date)
{
if (date < DateTime.Today.AddDays(1))
{
throw new InvalidOperationException("Route can only plan from tomorrow.");
}
Status = RouteStatus.Planned;
Date = date;
}
...
{
"ID":"3f86959a-6970-485c-9a1a-ba168cb77212",
"Date":"2016-05-26T00:00:00",
"Stops":{
"$type":"System.Collections.Generic.List`1[[Soloco.Talks.PolyglotPersistence.Stop, Soloco.Talks.PolyglotPersistence]], mscorlib",
"$values":[
{
"Name":"Home",
"Position":{ "Latitude":4.481736, "Longitude":51.197894 }
},
{
"Name":"WooRank",
"Position":{ "Latitude":4.400963, "Longitude":50.828417 }
},
{
"Name":"Home",
"Position":{ "Latitude":4.481736, "Longitude":51.197894 }
}
]
},
"Status":"Planned"
}
Event Driven Architecture
synchronous
synchronous
synchronous
asynchronous
(a)synchronyous
Relational
Event Store
Document Database
Key/value
(hstore)
* Not Marten
*
*
Tim Cools ( @timcoolsnet )