Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
LEVELUP 2015 - Enterprise software schaalbaar m...
Search
Michiel Overeem
November 26, 2015
Technology
0
250
LEVELUP 2015 - Enterprise software schaalbaar maken met Service Fabric
hoe AFAS zijn next gen ERP platform ontwikkelt
Michiel Overeem
November 26, 2015
Tweet
Share
More Decks by Michiel Overeem
See All by Michiel Overeem
Reminiscing a crazy journey: building an event sourced ERP system
overeemm
0
90
EventSourcing.Live 2021 - A system with thousands of event types
overeemm
0
310
EventSourcing.Live 2021 - Event system evolution - A Scientific Study on Event Sourcing, Lessons from Industry
overeemm
0
290
DDDVienna - 103 years of event sourcing experience
overeemm
0
390
DDDVienna - Applying event sourcing and CQRS in a large ERP system
overeemm
1
1.1k
Landelijk Architectuur Congres - The dark side of event sourcing: managing data conversion
overeemm
0
320
Dutch .NET Group Meetup - Building an event sourced system in .NET
overeemm
0
410
Drukwerkdeal.nl Developer Meetup - Event Sourcing After Launch
overeemm
0
230
DDDEurope 2018 - Event Sourcing After Launch
overeemm
5
2.4k
Other Decks in Technology
See All in Technology
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.1k
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
37
12k
個人でもIAM Identity Centerを使おう!(アクセス管理編)
ryder472
3
180
透過型SMTPプロキシによる送信メールの可観測性向上: Update Edition / Improved observability of outgoing emails with transparent smtp proxy: Update edition
linyows
2
210
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
940
AIチャットボット開発への生成AI活用
ryomrt
0
170
VideoMamba: State Space Model for Efficient Video Understanding
chou500
0
190
Terraform未経験の御様に対してどの ように導⼊を進めていったか
tkikuchi
2
430
The Role of Developer Relations in AI Product Success.
giftojabu1
0
120
Why App Signing Matters for Your Android Apps - Android Bangkok Conference 2024
akexorcist
0
120
TypeScriptの次なる大進化なるか!? 条件型を返り値とする関数の型推論
uhyo
2
1.6k
Security-JAWS【第35回】勉強会クラウドにおけるマルウェアやコンテンツ改ざんへの対策
4su_para
0
170
Featured
See All Featured
BBQ
matthewcrist
85
9.3k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Documentation Writing (for coders)
carmenintech
65
4.4k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
The Pragmatic Product Professional
lauravandoore
31
6.3k
Thoughts on Productivity
jonyablonski
67
4.3k
RailsConf 2023
tenderlove
29
900
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Transcript
Enterprise software schaalbaar maken met Service Fabric hoe AFAS zijn
next gen ERP platform ontwikkelt
360+ medewerkers (4 locaties) 10.000 klanten (bedrijven) 1.500.000 gebruikers 80
miljoen euro omzet (2014) AFAS Software
AFAS Profit Maandelijks 1.500.000 loonstroken HRM, CRM, financieel, order management,
project management, workflow, ...
AFAS Online 1780 cores, 25 TB RAM, 180 TB SSD
storage 10.000 concurrent RDP gebruikers 200.000 unieke gebruikers per maand 1.500.000 API calls per dag
Software kun je definiëren in plaats van programmeren.
Modelleer het bedrijf met zijn processen
Sla het model op in een definitie
Lees de definitie in een generator
Lever de resulterende applicatie uit
None
client command-systeem query-systeem event bus
Command public class CreateArticleCommand : Command { public Guid ArticleId
{ get; set; } public string Description { get; set; } public decimal Price { get; set; } } Event public class ArticleCreatedEvent : Event { public Guid ArticleId { get; set; } public string Description { get; set; } public decimal Price { get; set; } } Query public class GetArticleQuery : Query { public Guid ArticleId { get; set; } }
client query-systeem event bus command-systeem
AggregateRoot - Handle public void Handle(CreateArticleCommand command) { if(command.Price <=
0) { throw new CommandValidationException("Price should be greater than 0."); } if(string.IsNullOrEmpty(command.Description) || command.Description.Length > 20) { throw new CommandValidationException("Description is mandatory, " + "and cannot be longer than 20 characters."); } RaiseEvent(new ArticleCreatedEvent(command.ArticleId, command.Description, command.Price)); } AggregateRoot - Apply private void Apply(ArticleCreatedEvent @event) { _saleable = true; _price = @event.Price; }
client query-systeem event bus
CommandHandler private void Handle(CreateArticleCommand command) { Repository.ExecuteOn<ArticleAggregateRoot>(command.ArticleId, command); } AggregateRootRepository
- InMemory public virtual async Task ExecuteOn<T>(Guid aggregateId, Command command) where T: AggregateRoot { T aggregateRoot = LoadAggregateRoot<T>(aggregateId); aggregateRoot.Handle(command); await SaveAndDispatchEvents(aggregateRoot); }
1 3 7 4 8 2 8 6 5 1
3 1 4 6 2 7 6 5 4 8 3 7 2 5
“Actors are isolated, single-threaded components that encapsulate both state and
behavior.”
1 3 7 4 8 2 8 6 5 1
3 1 4 6 2 7 6 5 4 8 3 7 2 5
service systeem reliable collections communicatie actors service API service systeem
reliable collections communicatie service API
client query-systeem event bus
AggregateRootRepository - InMemory public virtual async Task ExecuteOn<T>(Guid aggregateId, Command
command) where T: AggregateRoot { T aggregateRoot = LoadAggregateRoot<T>(aggregateId); aggregateRoot.Handle(command); await SaveAndDispatchEvents(aggregateRoot); } AggregateRootRepository – Service Fabric public override async Task ExecuteOn<T>(Guid aggregateId, Command command) { var actor = ActorProxy.Create<IAggregateRootActor>(new ActorId(aggregateId), "App"); await actor.ExecuteOn(typeof(T).AssemblyQualifiedName, command.ToJson()); }
AggregateRootActor public async Task ExecuteOn(string aggregateRootType, string commandJson) { var
aggregateRoot = LoadAggregateRoot(aggregateRootType); var command = Deserialize(commandJson); aggregateRoot.Handle(command); await SaveAndDispatchEvents(aggregateRoot); }
één Stateless Actor Type Range partitions voor load balancing Actor
Id is het Id van de AggregateRoot
client command-systeem event bus query-systeem
QueryModelBuilder private void Handle(ArticleCreatedEvent @event) { Repository.Add(@event.ArticleId, new JObject( new
JProperty("Article", @event.ArticleId), new JProperty("Description", @event.Description), new JProperty("Price", @event.Price))); } QueryHandler private JObject Handle(GetArticleQuery query) { return Repository.Get(query.ArticleId); }
client command-systeem event bus
client command-systeem event bus
QueryModelBuilder Service public async Task Handle(string eventJson) { var queue
= await StateManager.GetOrAddAsync<IReliableQueue<string>>("qmbQueue"); using(ITransaction tx = StateManager.CreateTransaction()) { await queue.EnqueueAsync(tx, eventJson); await tx.CommitAsync(); } }
QueryModelBuilder Service protected override async Task RunAsync(CancellationToken cancellationToken) { var
queue = await StateManager.GetOrAddAsync<IReliableQueue<string>>("qmbQueue"); while(true) { using(ITransaction tx = StateManager.CreateTransaction()) { ConditionalResult<string> dequeueReply = await queue.TryDequeueAsync(tx); if(dequeueReply.HasValue) { string message = dequeueReply.Value; _queryModelBuilder.Handle(Deserialize(message)); await tx.CommitAsync(); } } } }
één Stateful Service Type Named partitions voor load balancing Partition
name is het type van de QueryModelBuilder
None
Voor vragen, discussie etc:
[email protected]
- @michielovereem - https://linkedin.com/in/movereem CQRS
+ Service Fabric • Sluit ontzettend goed aan bij onze architectuur. • Betrouwbaarheid, schaalbaarheid en onderhoudsgemak. • Portable cloud hosting is mogelijk. https://github.com/AFASSoftware/CQRS-Microservices