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
320
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
LEVELUP 2015 - Enterprise software schaalbaar maken met Service Fabric
hoe AFAS zijn next gen ERP platform ontwikkelt
Michiel Overeem
November 26, 2015
More Decks by Michiel Overeem
See All by Michiel Overeem
Reminiscing a crazy journey: building an event sourced ERP system
overeemm
0
230
EventSourcing.Live 2021 - A system with thousands of event types
overeemm
0
430
EventSourcing.Live 2021 - Event system evolution - A Scientific Study on Event Sourcing, Lessons from Industry
overeemm
0
400
DDDVienna - 103 years of event sourcing experience
overeemm
0
480
DDDVienna - Applying event sourcing and CQRS in a large ERP system
overeemm
1
1.4k
Landelijk Architectuur Congres - The dark side of event sourcing: managing data conversion
overeemm
0
430
Dutch .NET Group Meetup - Building an event sourced system in .NET
overeemm
0
630
Drukwerkdeal.nl Developer Meetup - Event Sourcing After Launch
overeemm
0
300
DDDEurope 2018 - Event Sourcing After Launch
overeemm
5
2.6k
Other Decks in Technology
See All in Technology
手塩にかけりゃいいってもんじゃない
ming_ayami
0
360
現地で盛り上がった WWDC26 Keynote
zozotech
PRO
1
200
Chainlitで作るお手軽チャットUI
ynt0485
0
200
スキルと MCP ツール、責務をどう分けるか? AI が迷わないインターフェース設計の戦略
cdataj
1
950
RSA暗号を手計算したくなること、ありますよね?? (20260615_orestudy6_rsa)
thousanda
0
230
AmazonRoute 53ではじめてのドメイン取得!HTTPS化までの道のりを整理してみた
usanchuu
3
130
Android の公式 Skill / Android skills
yanzm
0
130
2026TECHFRESH畢業分享會 - 原生還是跨平台? App 開發踩坑實錄
line_developers_tw
PRO
0
810
ポケモンの型をTypeScriptの型システムで表現してみた
subroh0508
0
370
SIer20年! 培ったスキルがスタートアップで輝く時
shucho0103
0
840
Claude Code×Terraform IaC テンプレート駆動開発
itouhi
1
490
エンジニアリング戦略の作り方 / Crafting Engineering Strategy
iwashi86
20
6.6k
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
528
40k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
160
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
580
Six Lessons from altMBA
skipperchong
29
4.3k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
160
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
390
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
Into the Great Unknown - MozCon
thekraken
41
2.6k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
140
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
sira's awesome portfolio website redesign presentation
elsirapls
0
280
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