This document summarizes a presentation about implementing a digital government messaging platform in the Netherlands using microservices and an event-driven architecture. The key points are:
- The Dutch government implemented a centralized messaging platform called BBO to digitally deliver notices from various government agencies and utilities to citizens.
- BBO uses a microservices architecture with independent services for receiving, validating, sorting, notifying and retrieving messages. It also leverages event-driven design with Kafka to decouple services.
- The system is highly scalable, secure, available and auditable. It processes over 5 million messages per day from over 600 senders to 9 million users.
- Implementing an event-driven micro
2. Š 2023 CGI Inc. Public
Government Goes Digital!
All communications for citizens and organizations
from Goverment (central and decentralized)
and Public Utilities is made available through digital means
2
3. Š 2023 CGI Inc. Public 3
⢠Founded 1976
⢠Consultants and professionals 90,250
⢠Locations worldwide 400
⢠F2022 revenue C$12.87B
⢠End-to-end services clients globally 5,500
⢠Clients through our IP-based solutions 50,000
⢠Stock symbols:
â NYSE: GIB
â TSX: GIB.A
4. Š 2023 CGI Inc. Public 4
About me
MichaĂŤl
van der Haven
Vice President Consulting Expert
(Renewable) Energy
CGI
5. Š 2023 CGI Inc. Public
Digital Government: In Practice
⢠The Blue Envelope
â The most infamous letter in The Netherlands
â Invite to pay taxes and all other associated tax
correspondations
⢠But also
â Pension notices
â Compensation schemes
â Reminders to mandatory car inspections
â Vaccination invites
â Local municipality maintenance notices
â Etc.
5
⢠600+ âsendersâ
⢠9+ million users
⢠5+ million messages sent
per day
⢠4+ million messages requested
per day
6. Š 2023 CGI Inc. Public
This excuse does not work anymore
6
7. Š 2023 CGI Inc. Public
BBO: The Messaging Platform
Berichtenbox voor Burgers en Ondernemers
(message-box for citizens and organizations)
⢠Stakeholders send their messages
to a central location: BBO
â Receives
â Validates
â Sorts
â Notifies
â Makes Available
⢠Manages all legislation topics
â Retention (archival law)
â Locking (legal disputes)
â Audit
â Etc.
7
8. Š 2023 CGI Inc. Public
Microservices
8
Requirements
(non
functional)
Highly secure
Allways on
Auditable
Allways Available Ă No impact
by performance demands
Scalable Horizontal
Vertical
Reuse of resources
Monitoring
Self-healing
9. Š 2023 CGI Inc. Public
Still Microservices?
Prevent congestion at all costs
⢠Receive
â Senders donât want to wait until
youâre done sorting each message
including that of other senders
⢠Process
â Validation and sorting can be at
a different speed: messages often
have a future publication date
⢠Serve Requests
â Citizen doesnât want to be impacted
by others or messages that are
being sent
9
10. Š 2023 CGI Inc. Public
Yes: Microservices, not nano-services
⢠Different Service Levels
⢠Different Kinds of services
⢠Completely independent (i.e. not the Amazon Prime use-case)
10
Receive
Receive
Receive
Validate
Sort
Validate
Sort
Notify
Retrieve
Retrieve
BBO
11. Š 2023 CGI Inc. Public
Š 2023 CGI Inc. 11
Event Driven
The Kafka Case
⢠Microservices with different scaling
requirements
⢠More than one interested
consumer
⢠Microservices should only âactâ
when something becomes relevant
12. Š 2023 CGI Inc. Public
Zooming in
1. A receiving service handles a message or
batch of messages
a) Stores the message in S3 (on-premise MinIO)
b) Post an event that initial reception is done
2. RPO=0 Requirement
Buckets in multiple data centers
3. Publish S3 Replication Events
4. Kafka Stream combines to Received
RPO=0 Guaranteed
5. Acknowledgement to sender
(your message is safe! We will handle the rest)
6. Other consumers
(Validated, Reporting, Audit Log)
will consume the same stream and follow with their
own business actions
12
Receive Validate Report Audit
Inbox
Initial Reception
Stored and
Replicated
Received
1
1a
1b
2
3
4
5 6
13. Š 2023 CGI Inc. Public
Event Driven: Self Healing System
Utilizing Event Driven Concepts (and a lot of Kubernetes)
to automatically recover from failure
Event Driven
⢠Store the state of events
⢠Idempotent
⢠Each process results in
exactly the same result
Replay
⢠Process events again
⢠Anything new âafterâ the
snapshot is processed
⢠Idempotency
⢠Downstream services âknowâ
that the event does not have
to be processed again
Kubernetes
⢠State store snapshots
⢠Persistent Volumes
⢠Snapshots
⢠Recover from an older
snapshot in case of
detected failure
13
14. Š 2023 CGI Inc. Public
The proof of the pudding is in eating
⢠Replay as part of deployment
â Z-Shaped deployments
â Prove that a solution can always be
rolled back
â Deploy into representative environment
â Test on actual data
â Roll back
â Play again and show that the complete
system still works
14
15. Š 2023 CGI Inc. Public
Replay and Snapshots
⢠Kubernetes & MongoDb state database
â State:
§ MongoDb to store which events have been processed
(yes the collection is very simple)
â Kubernetes Snapshots
§ Each snapshot virtually points to a location on a Kafka
topic
â Kubernetes Hydrating a new PV or existing PV
§ The new MongoDb server has state data that points to
a location on the topic that the original service had not
processed yet
â Microservice & Kafka Ă Replay
§ Deploy a new service and let it work on the new
database
§ The service will automatically âreplayâ everything on the
topic
15
t
t(0) t(1) t(n)
t(n-1)
16. Š 2023 CGI Inc. Public
Š 2023 CGI Inc.
⢠Yes, you can do everything yourself
⢠It is a lot of Ops work though
⢠Managed platform
⢠Axual
⢠Main Drivers:
â Topic and Connection Overview
â Integration with Keyvault systems
â Programmable Part of CI/CD
â Clear DTAP management
⢠Disadvantage: Vendor specific
(and this is a problem with all commercial Kafka providers)
⢠Operators
⢠KSQL types of languages
⢠Schema management
⢠Etc
Managing Kafka
16
DIY or Managed solution?
⢠Normal Topics (BBO: 10+)
⢠Streams (BBO: 20+)
⢠Operational tasks and challenges
⢠Security (20+ services)
⢠Performance
⢠Reuse of Kafka outside of BBO
17. Š 2023 CGI Inc. Public
Developer Experience
Perception & Skills
⢠Microservices are not easy
⢠Event Driven is not easy
Developers (non) comforts:
⢠Atomic services à Balancing act, not
too atomic
(recall the Amazon Prime case)
⢠Limited scope of a service
⢠Object Oriented across services
⢠Embrace reuse of code in the form of
copy-paste
Or
⢠Excellent library management
Testing
⢠Consumer Driven Contract Based
Testing with Events
It is too tempting to let the producer
rule
DevOps
⢠CI/CD Pipeline
â Templates
â Branching merging
â Etc.
â Getting used to The C truly becomes
continuous
17
18. Š 2023 CGI Inc. Public
Insight is a gamechanger
⢠Developers may be working in an atomic service
⢠Atomic or not: if another service is not doing its
job the system fails
⢠Provide insight in
â What topics are available
â Who is producing and who is consuming?
18
Axual Metro Map
⢠Results
â Finding bugs
â Finding dead topics
â Finding producers without consumers and vice
versa
â Fix and export and make it part of CI/CD
19. Š 2023 CGI Inc. Public
Current State
⢠Matured Team
â Well Established testing framework including PACT
â Z-Shaped Deployment
â Secure
â Insight!
⢠Performance?
â Kafka
§ Bare minimum set of brokers for RPO=0
§ 30+ MM events per day
Ă Kafka walk in the park
â Services
§ Vertical Scaling Challenges
§ Internal Optimization
§ Fewer functionalities
§ How micro is micro?
19
20. Š 2023 CGI Inc. Public
Conclusions and Lessons Learned
20
⢠An event driven architecture works
â Supports the Micro Service Pattern
â Self Healing System
â Highly performant and scalable
â Ideal to âdetect & manageâ RPO=0 requirements
â Kubernetes, Kafka and MongoDb are a golden combination
⢠An event driven architecture is hard for developers
â Invest in training
â Have seniors that can teach on the job
â Shared code management becomes more challenging
â A system that provides an overview is a gamechanger!
⢠Managed Platform vs DIY Open Source
â DIY
§ Using Kafka with two or three services can perfectly be done with open source
â Managed
More services, more streams, more topics AND security:
§ Managed platform
§ Axual was a front-runner with their management platform
§ The competitive landscape is on-par
§ Choose your poison
o Operators
o Streaming Language
21. cgi.com
Insights you can act on
Founded in 1976, CGI is among the largest IT and business
consulting services firms in the world.
We are insights-driven and outcomes-based to help accelerate
returns on your investments. Across hundreds of locations
worldwide, we provide comprehensive, scalable and sustainable IT
and business consulting services that are informed globally and
delivered locally.