💻
Software Development
Technical Knowledges
Technical Knowledges
  • Everything anyone should know
    • Fundamental
      • Life cycle of Dependency Injection
        • When to use?
          • Transient
          • Scoped
          • Singleton
      • OOP
        • Inheritance
          • More with override in C#
            • Why need to use "virtual" keyword when we can use "new" keyword
          • How to achieve multiple inheritance in C#
          • Note
        • Polymophism
        • Encapsulation
        • Abtraction
          • Not use "override" keyword in abstract method
          • Notes
      • Data representing
        • JSON
        • XML
        • Comparation
      • Middleware
      • Status Code
      • API Styles
        • SOAP
        • REST
          • Question
        • GraphQL
        • gRPC
        • WebSocket
        • Webhook
        • Comparation
          • SOAP vs REST
          • REST vs GraphQL
          • gRPC vs REST
          • HTTP vs WebSocket
      • SDK
    • Advanced
      • Memoize
      • N+1 issues
      • Concurrency
        • Thread
          • Race Condition
          • Thread Safety
          • Critical Sections
        • Deadlock
        • Semaphore
    • Comparison
      • Architecture
        • SOA vs Microservices
        • Strong Consistency vs Eventual Consistency
      • Data structures
        • Instance vs Object
        • Field vs Property
        • Properties vs Method
        • Class vs Struct
        • const vs readoly vs static
        • Value types and Reference types
        • i++ vs ++i
        • Prototypal Inheritance vs Class Inheritance
        • Abstraction vs Interface
        • Run-time vs Compile-time
        • Overloading vs Overriding
      • Front-end
        • SSR vs SPA
        • Axios vs Fetch
      • Databases
        • Different between Function() and Store Procedure()
      • Security
        • Encoding vs Encryption vs Tokenization
      • Message Broker
        • RabbitMQ vs Kafka
      • Devops
        • Kubernetes vs Docker Swarm
        • Docker Repository vs Docker Registry
      • Cloud
      • Computer Science
        • Recursion and Iteration
      • Technology
        • .NET Core vs .NET Framework
        • Cache vs Local Storage vs Session Storage vs Cookies
      • SDLC
        • TDD vs BDD
  • Design Pattern
    • Overview
    • Creational Design Patterns
      • Abstract Factory
        • Code Example
          • C#
          • Java
          • Python
      • Builder
        • Code Example
          • C#
          • Java
          • Python
      • Factory Method
        • Code Example
          • C#
          • Java
          • Python
      • Prototype
        • Code example
          • C#
          • Java
          • Python
      • Singleton
        • Code example
          • C#
            • Naïve Singleton
            • Thread-safe Singleton
          • Java
            • Naïve Singleton (single-threaded)
            • Naïve Singleton (multithreaded)
            • Thread-safe Singleton with lazy loading
          • Python
            • Naïve Singleton
            • Thread-safe Singleton
    • Structural Design Patterns
      • Adapter
        • Code example
          • C#
          • Java
          • Python
            • Conceptual Example (via inheritance)
            • Conceptual Example (via object composition)
      • Bridge
        • Code example
          • C#
          • Java
          • Python
      • Composite
        • Code example
          • C#
          • Java
          • Python
      • Decorator
        • Code example
          • C#
          • Java
          • Python
      • Facade
        • Code example
          • C#
          • Java
          • Python
      • Flyweight
        • Code example
          • C#
          • Java
          • Python
      • Proxy
        • Code example
          • C#
          • Java
          • Python
    • Behavior Design Patterns
      • Chain of Responsibility
        • Code example
          • C#
          • Java
          • Python
      • Command
        • C#
        • Java
        • Python
      • Interpreter
        • Code example
          • C#
      • Iterator
        • Code example
          • C#
          • Java
          • Python
      • Mediator
        • Code example
          • C#
          • Java
          • Python
      • Memento
        • Code example
          • C#
          • Java
          • Python
      • Observer
        • Code example
          • C#
          • Java
          • Python
      • State
        • Code example
          • C#
          • Java
          • Python
      • Strategy
        • Code example
          • C#
          • Java
          • Python
        • Different with using abstract class
      • Template Method
        • Code example
          • C#
          • Java
          • Python
      • Visitor
        • Code example
          • C#
          • Java
          • Python
    • Use cases
      • Real-life example
    • More
      • Circuit Breaker Pattern
      • Repository Pattern
      • Unit Of Work Pattern
    • Some design patterns contradictory
  • Architect
    • Clean Architecture
    • Layered (n-tier) Architecture
    • Microservices Architecture
    • Monolithic Architecture
    • Service-Oriented Architecture (SOA)
    • Domain-Driven Design (DDD)
    • Blackboard Architecture
    • Object-Oriented Architecture
  • Microservices Design Pattern
    • Saga Pattern
      • Example
    • Strangler Fig Pattern
    • API Gateway Pattern
    • Backends For Frontends (BFF) Pattern
    • Service Discovery Pattern
    • Circuit Breaker Pattern
    • Bulk Head Pattern
    • Retry Pattern
    • Sidecar Pattern
    • Event Driven Architecture Pattern
    • CQRS (Command and Query Responsibility Segregation)
      • Event Sourcing
      • Code example
        • Basic
        • CQRS + MediatR + EDA + RabbitMQ
      • The Good, the Bad, and the Ugly
    • Configuration Externalization Pattern
  • Design and development principles
    • SOLID aka Design Principles
    • Cohesion Principles
    • Coupling principle
    • Some fundamental principles
      • Separation of Concerns
      • Persistence Ignorance
      • DRY
      • KISS
  • Authentication and Authorization Standards
    • SAML
    • OAuth
    • OIDC
    • SCIM
    • SSO
    • Tools
      • Keycloak
    • More
      • JWT
      • Access Token & Refresh Token
  • .NET TECHNOLOGY
    • .NET MVC
      • HTML Helpers
        • Extension method for HTML Helpers
      • Filters
        • Order of Filters
    • Fundamental
      • Startup file
      • Query Data
        • Linq
          • Filtering
          • Sorting
          • Projecting
          • Quantifying
          • Flattening
          • Grouping
          • Joining
          • Aggregating
          • Deferred execution vs Immediate execution
        • OData
          • Filter Expression
      • ORM
        • Entity Framework
          • Eager Loading vs Lazy Loading vs Explicit Loading
          • How to improve our entity framework core query performance
        • Dapper
        • Why Dapper faster than Entity Framework
      • Identity Server
      • Fluent Validation
      • Minimal API
      • Generic
      • IoC
        • Castle Windsor
        • Autofac
        • Ninject
      • CLR
      • Refit
      • Task Schedule
        • Hangfire
        • Quartz
      • Some notice
    • Advanced
      • Multi Thread
        • Thread pool
        • Parallel
        • Comparation
        • Code comparation
      • Caching
        • IMemoryCache
      • MediatR
      • SignalR
      • API Gateway
        • Ocelot
      • gRPC
      • Multitenancy
      • Special C# technique
        • Generic
        • Extension Method
        • Delegate
        • Lambda Expression
        • Yield
      • Jetbrain tools
        • dotTrace
        • dotMemory
        • dotPeek
      • ABP Framework
        • Multi Layered
          • Domain Layer
            • Entities
            • Repository
            • Domain Services
          • Application Layer
            • Application Services
            • Data Transfer Objects
          • Data Access
            • Entity Framework Core Integration
            • MongoDB Integration
        • Microservice Architecture
        • DDD
          • Domain Layer
            • Entities & Aggregate Roots
            • Value Objects
            • Repositories
            • Domain Services
            • Specifications
          • Application Layer
            • Application Services
            • Data Transfer Objects
            • Unit of Work
    • Tutorial Coding
      • Custom and Using Middleware in .NET CORE
      • Connect Elastic Search and MongoDB
      • Implementing the Unit of Work Pattern in Clean Architecture with .NET Core
    • ServiceStack
    • POCO
  • System Design
    • Blueprint
    • Fundamental
      • Scale from zero to millions of users
        • Single server setup
        • Database
        • Load balancer
        • Database replication
        • Cache
        • Content delivery network (CDN)
        • Stateless web tier
        • Data centers
        • Message queue
        • Logging, metrics, automation
        • Database scaling
        • Millions of users and beyond
      • A framework for system design interviews
        • Step 1 - Understand the problem and establish design scope
        • Step 2 - Propose high-level design and get buy-in
        • Step 3 - Design deep dive
        • Step 4 - Wrap up
        • Summarize
      • Back-of-the-envelope estimation
      • Design a rate limiter
        • Step 1 - Understand the problem and establish design scope
        • Step 2 - Propose high-level design and get buy-in
          • Algorithms for rate limiting
            • Token bucket algorithm
            • Leaking bucket algorithm
            • Fixed window counter algorithm
            • Sliding window log algorithm
            • Sliding window counter algorithm
          • High-level architecture
        • Step 3 - Design deep dive
          • Rate limiting rules
          • Exceeding the rate limit
          • Detailed design
          • Rate limiter in a distributed environment
          • Performance optimization
          • Monitoring
        • Step 4 - Wrap up
      • Design consistent hashing
        • Consitent hashing
        • Two issues in the basic approach
        • Wrap up
      • Design key-value store
        • Understand the problem and establish the design scope
        • CAP theorem
        • System components
          • Data partition
          • Data replication
          • Consistency
          • Inconsistency resolution
          • Handling failures
          • System architecture diagram
          • Write path
          • Read path
      • Design a unique id generator in distributed systems
        • Step 1 - Understand the problem and establish design scope
        • Step 2 - Propose high-level design and get buy-in
          • Multi-master replication
          • UUID
          • Ticket Server
          • Twitter snowflake approach
        • Step 3 - Design deep dive
        • Step 4 - Wrap up
      • Design a url shortener
        • Step 1 - Understand the problem and establish design scope
        • Step 2 - Propose high-level design and get buy-in
        • Step 3 - Design deep dive
          • Data model
          • Hash function
          • URL shortening deep dive
          • URL redirecting deep dive
        • Step 4 - Wrap up
      • Design a web crawler
        • Step 1 - Understand the problem and establish design scope
        • Step 2 - Propose high-level design and get buy-in
        • Step 3 - Design deep dive
          • DFS vs BFS
          • URL frontier
          • HTML Downloader
          • Robustness
          • Extensibility
          • Detect and avoid problematic content
        • Step 4 - Wrap up
    • Use cases
      • Design Youtube
      • Design Social Media App
      • Design Typehead Suggestion
      • Design Taxi Booking System
      • Design Messaging App
  • DBMS
    • Fundamental
      • ACID
      • Order Of Execution of the SQL query
      • Transaction – Concurrency Control Techniques
        • Isolation level
      • Index
        • Clustered Index vs Non-clustered index
        • Index vs Unique index
      • Built-in functions
        • String Functions
          • ASCII
          • CHAR
          • CHARINDEX
          • CONCAT
          • CONCAT_WS
          • DATALENGTH
          • DIFFERENCE
          • FORMAT
          • LEFT
          • LEN
          • LOWER
          • LTRIM
          • NCHAR
          • PATINDEX
          • QUOTENAME
          • REPLACE
          • REPLICATE
          • REVERSE
          • RIGHT
          • RTRIM
          • SOUNDEX
          • SPACE
          • STR
          • STUFF
          • SUBSTRING
          • TRANSLATE
          • TRIM
          • UNICODE
          • UPPER
        • Numeric Functions
          • ABS
          • ACOS
          • ASIN
          • ATAN
          • ATN2
          • AVG
          • CEILING
          • COUNT
          • COS
          • DEGREES
          • EXP
          • FLOOR
          • LOG
          • LOG10
          • MAX
          • MIN
          • PI
          • POWER
          • RADIANS
          • ROUND
          • SIGN
          • SIN
          • SQRT
          • SQUARE
          • SUM
          • TAN
        • Date Functions
          • CURRENT_TIMESTAMP
          • DATEADD
          • DATEDIFF
          • DATEFROMPARTS
          • DATENAME
          • DATEPART
          • DAY
          • GETDATE
          • GETUTCDATE
          • ISDATE
          • MONTH
          • SYSDATETIME
          • YEAR
        • Advance Functions
          • CASE
          • CAST
          • COALESCE
          • CONVERT
          • CURRENT_USER
          • LEAD
          • LAG
          • IIF
          • ISNULL
          • ISNUMERIC
          • NULLIF
          • SESSION_USER
          • SESSIONPROPERTY
          • SYSTEM_USER
          • USER_NAME
      • SQL Best Practice
      • Execution Plan
      • Optimize query execution
    • Advanced
      • CTE
      • Window function
      • Performance Tuning
        • Query tuning
        • Interview ques
      • DB Sharding
      • Concurrency Control
        • Optimistic lock
        • Pessimistic lock
      • Compare DELETE VS TRUNCATE
    • Comparation
      • Oracle vs SQL Server vs Postgre vs Mysql
  • Javascript
    • ES6 Techniques
      • Hoisting
      • Destructing
      • Spread Operator
      • Rest Operator
    • Basic
      • Const vs Let vs Var
      • Debounce & Throttle
      • Callback()
    • 5 ways to define a function
  • Clean code
    • Page 2
  • Search Engine
    • Elastic Search
      • Interview question
      • Code Example
    • Solr
    • IBM Watson Discovery
    • Google Cloud Search
    • Coveo Relevance Cloud
  • Cloud Service
    • Overview
    • Azure
      • Certificate
        • AZ-900
          • Describe cloud concepts
            • What is Cloud Computing?
            • Benefits of using cloud services
              • High Availability and Scalability
              • High Elasticity
              • High Reliability and Predictability
              • High Security and Governance
              • High manageability
            • IaaS vs PaaS vs SaaS
            • Cloud Deployment Models
            • CAPEX vs OPEX
          • Describe Azure architecture and services
            • Describe the core architectural components of Azure
              • Learn sandbox
              • Azure physical infrastructure
              • Azure management infrastructure
              • Create an Azure resource
            • Describe Azure compute and networking services
              • Azure Virtual Machines
              • Create an Azure Virtual Machine
              • Azure Virtual Desktop
              • Azure Containers
              • Azure Function
              • Describe application hosting options
              • Configure network access
              • Describe Azure Virtual Networking
              • Azure Virtual Private Networks
              • Azure ExpressRoute
              • Azure DNS
            • Describe Azure storage services
              • Azure storage accounts
              • Azure storage redundancy
              • Azure storage services
              • Create a storage blob
              • Identify Azure data migration options
              • Identify Azure file movement options
            • Describe Azure identity, access, and security
              • Azure directory services
              • Azure authentication methods
              • Azure external identities
              • Azure conditional access
              • Azure role-based access control
              • Zero trust model
              • Defense-in-depth
              • Microsoft Defender for Cloud
          • Describe Azure management and governance
            • Describe cost management in Azure
              • Factors that can affect costs in Azure
              • Compare the Pricing and Total Cost of Ownership calculators
              • Estimate workload costs by using the Pricing calculator
              • Compare workload costs using the TCO calculator
              • Azure Cost Management tool
            • Describe features and tools in Azure for governance and compliance
              • Azure Blueprints
              • Azure Policy
              • Purpose of resource locks
              • Configure a resource lock
              • Service Trust portal
            • Describe features and tools for managing and deploying Azure resources
              • Tools for interacting with Azure
              • Azure Arc
              • Azure Resource Manager and Azure ARM templates
            • Describe monitoring tools in Azure
              • Azure Advisor
              • Azure Service Health
              • Azure Monitor
        • SC-900
          • Describe the concepts of security, compliance, and identity
            • Describe security and compliance concepts
              • Shared responsibility model
              • Defense in depth
              • Zero Trust model
              • Encryption and hashing
              • Compliance concepts
            • Describe identity concepts
              • Authentication and authorization
              • Identity as the primary security perimeter
              • Role of the identity provider
              • Directory services and Active Directory
              • Federation
          • Describe the capabilities of Microsoft Azure Active Directory, part of Microsoft Entra
            • Describe the services and identity types of Azure AD
              • Azure Active Directory
              • Available Azure AD editions
              • Azure AD identity types
              • Types of external identities
              • Concept of hybrid identity
            • Describe the authentication capabilities of Azure AD
              • Authentication methods available in Azure AD
              • Multi-factor authentication (MFA) in Azure AD
              • Self-service password reset (SSPR) in Azure AD
              • Password protection and management capabilities of Azure AD
            • Describe the access management capabilities of Azure AD
              • Conditional Access in Azure AD
              • Benefits of Azure AD roles and role-based access control
            • Describe the identity protection and governance capabilities of Azure AD
              • Identity governance in Azure AD
              • Entitlement management and access reviews
              • Privileged identity Management
              • Azure Identity Protection
          • Describe the capabilities of Microsoft security solutions
            • Describe basic security capabilities in Azure
              • Azure DDoS protection
              • Azure Firewall
              • Web Application Firewall
              • Network segmentation in Azure
              • Azure Network Security groups
              • Azure Bastion and JIT Access
              • Describe ways Azure encrypts data
            • Describe security management capabilities of Azure
              • Cloud security posture management
              • Microsoft Defender for Cloud
              • Enhanced security of Microsoft Defender for Cloud
              • Microsoft cloud security benchmark and security baselines for Azure
            • Describe security capabilities of Microsoft Sentinel
              • SIEM and SOAR
              • How Microsoft Sentinel provides integrated threat management
              • Understand Sentinel costs
            • Describe threat protection with Microsoft 365 Defender
              • Microsoft 365 Defender services
              • Microsoft Defender for Office 365
              • Microsoft Defender for Endpoint
              • Microsoft Defender for Cloud Apps
              • Microsoft Defender for Identity
              • Microsoft 365 Defender portal
          • Describe the capabilities of Microsoft compliance solutions
            • Describe the Service Trust Portal and privacy at Microsoft
              • Service Trust Portal
              • Microsoft's privacy principles
              • Microsoft Priva
            • Describe the compliance management capabilities in Microsoft Purview
              • Microsoft Purview compliance portal
              • Compliance Manager
              • Describe use and benefits of compliance score
            • Describe information protection and data lifecycle management in Microsoft Purview
              • Know your data, protect your data, and govern your data
              • Data classification capabilities of the compliance portal
              • Sensitivity labels and policies
              • Data loss prevention
              • Retention policies and Retention labels
              • Records management
            • Describe insider risk capabilities in Microsoft Purview
              • Risk management
              • Communication compliance
              • Information barriers
            • Describe the eDiscovery and audit capabilities of Microsoft Purview
              • eDiscovery solutions in Microsoft Purview
              • Audit solutions in Microsoft Purview
            • Describe resource governance capabilities in Azure
              • Azure Policy
              • Azure Blueprints
              • Capabilities in the Microsoft Purview governance portal
        • DP-900
          • Core Concept
            • Explore core data concepts
              • Data formats
              • File storage
              • Databases
              • Transactional data processing
              • Analytical data processing
            • Explore data roles and services
              • Job roles in the world of data
              • Identify data services
          • Relational Data in Azure
            • Explore fundamental relational data concepts
              • Relational data
              • Normalization
              • SQL
              • Database objects
            • Explore relational database services in Azure
              • Azure SQL services and capabilities
              • Azure services for open-source databases
              • Exercise: Explore Azure relational database services
          • Non-relational data in Azure
            • Explore Azure Storage for non-relational data
              • Azure blob storage
              • Azure DataLake Storage Gen2
              • Azure Files
              • Azure Tables
              • Exercise: Explore Azure Storage
            • Explore fundamentals of Azure Cosmos DB
              • Azure Cosmos DB
              • Identify Azure Cosmos DB APIs
              • Exercise: Explore Azure Cosmos DB
          • Data analytics in Azure
            • Explore fundamentals of large-scale data warehousing
              • Data warehousing architecture
              • Data ingestion pipelines
              • Analytical data stores
              • Exercise: Explore data analytics in Azure with Azure Synapse Analytics
            • Explore fundamentals of real-time analytics
              • Understand batch and stream processing
              • Explore common elements of stream processing architecture
              • Azure Stream Analytics
              • Exercise: Explore Azure Stream Analytics Completed
              • Apache Spark on Microsoft Azure
              • Exercise: Explore Spark Streaming in Azure Synapse Analytics Completed
            • Explore fundamentals of data visualization
              • Power BI tools and workflow
              • Core concepts of data modeling
              • Considerations for data visualization
              • Exercise – Explore fundamentals of data visualization with Power BI Completed
        • AI-900
      • Azure Subscription
      • Azure App Service
      • Azure Dictionary B2C
      • Azure Front Door
      • Azure Traffic Manager
      • Azure Load Balancer
      • Azure KeyVault
      • API Management
      • Azure Logic Apps
      • Azure Metric and Logs
      • Azure Workbooks
      • Azure Messaging Services
      • Azure Service Fabric
      • Comparison
        • Durable Function vs Logic App
        • Storage queues vs Service Bus queues
        • Event Grid vs Service Bus
    • AWS
      • Certificate
        • CLF-C02
          • Cloud Concepts
            • Cloud Computing
            • The Deployment Models of the Cloud
            • The Five Characteristics of Cloud Computing
            • Six Advantages of Cloud Computing
            • Problems solved by the Cloud
            • Types of Cloud Computing
            • Pricing of the Cloud
            • AWS Global Infrastructure
              • AWS Regions
              • AWS Availability Zones
              • AWS Points of Presence (Edge Locations)
            • Tour of the AWS Console
            • Shared Responsibility Model diagram
          • Security & Compliance
            • AWS Shared Responsibility Model
            • DDOS
            • Network Firewall
            • Penetration Testing on AWS Cloud
            • Encryption
            • AWS Certificate Manager (ACM)
            • AWS Secrets Manager
            • AWS Artifact (not really a service)
            • Amazon GuardDuty
            • Amazon Inspector
            • AWS Config
            • AWS Macie
            • AWS Security Hub
            • Amazon Detective
            • AWS Abuse
            • Root user privileges
            • IAM Access Analyzer
            • Summary
            • Advanced Identity
              • STS
              • Cognito
              • Directory Services
              • IAM Identity Center
              • Summary
          • Cloud Technology & Services
            • IAM
              • IAM: Users & Groups
              • IAM: Permissions
              • IAM Policies inheritance
              • IAM Policies Structure
              • IAM – Password Policy
              • Multi-Factor Authentication - MFA
              • How can users access AWS?
                • AWS CLI
                • AWS SDK
              • IAM Roles for Services
              • IAM Security Tools
              • IAM Guidelines & Best Practices
              • Shared Responsibility Model for IAM
              • Summary
            • EC2
              • Overview
              • EC2 Instance Types
                • Overview
                • General Purpose
                • Compute Optimized
                • Memory Optimized
                • Storage Optimized
                • Example
              • Security Groups
              • SSH in EC2
              • EC2 Instance Purchasing Options
                • On-Demand Instances
                • Reserved Instances
                • Savings Plans
                • Spot Instances
                • Dedicated Hosts
                • Dedicated Instances
                • Capacity Reservations
                • Summary
              • EC2 Instance Storage
                • EBS
                • EBS Snapshot
                • AMI
                • EC2 Image Builder
                • EC2 Instance Store
                • EFS
                • Shared Responsibility Model for EC2 Storage
                • Amazon FSx
                • Summary
            • ELB & ASG
              • High Availability, Scalability, Elasticity
              • ELB
              • ASG
              • Summary
            • Amazon S3
              • Overview
              • Security
              • Techniques
              • Shared Responsibility Model for S3
              • AWS Snow Family
              • Summary
            • Database & Analytics
              • Overview
              • RDS & Aurora
              • Amazon ElastiCache
              • DynamoDB
              • Redshift
              • EMR
              • Amazon Athena
              • Amazon QuickSight
              • DocumentDB
              • Amazon Neptune
              • Amazon QLDB
              • Amazon Managed Blockchain
              • AWS Glue
              • DMS – Database Migration Service
              • Summary
            • Other Compute Service
              • Docker
              • ECS
              • Fargate
              • ECR
              • AWS Lamda
              • Amazon API Gateway
              • AWS Batch
              • Amazon Lightsail
              • Summary
                • Other Compute - Summary
                • Lambda Summary
            • Deploying and Managing Infrastructure
              • CloudFormation
              • CDK
              • Elastic Beanstalk
              • AWS CodeDeploy
              • AWS CodeCommit
              • AWS CodePipeline
              • AWS CodeArtifact
              • AWS CodeStar
              • AWS Cloud9
              • SSM
              • AWS OpsWorks
              • Summary
            • Global Infrastructure
              • Overview
              • Route 53
              • CloudFront
              • AWS Global Accelerator
              • AWS Outposts
              • AWS WaveLength
              • AWS Local Zones
              • Global Applications Architecture
              • Summary
            • Cloud Integration
              • Overview
              • SQS
              • Kinesis
              • SNS
              • MQ
              • Summary
            • Cloud Monitoring
              • CloudWatch
              • EventBridge
              • CloudTrail
              • X-Ray
              • CodeGuru
              • Health Dashboard
              • Summary
            • VPC
              • Overview
              • IP Addresses in AWS
              • VPC Diagram
              • Core networking
              • VPC Flow Logs
              • VPC Peering
              • VPC Endpoints
              • AWS PrivateLink (VPC Endpoint Services)
              • Site to Site VPN & Direct Connect
              • AWS Client VPN
              • Transit Gateway
              • Summary
            • Machine Learning
              • Rekognition
              • Transcribe
              • Polly
              • Translate
              • Lex & Connect
              • Comprehend
              • SageMaker
              • Forecast
              • Kendra
              • Personalize
              • Textract
              • Summary
            • Other Services
              • WorkSpaces
              • AppStream 2.0
              • IoT Core
              • Elastic Transcoder
              • AppSync
              • Amplify
              • Device Farm
              • Backup
              • Disaster Recovery Strategies
              • AWS Elastic Disaster Recovery (DRS)
              • DataSync
              • Application Discovery Service
              • Application Migration Service (MGN)
              • Migration Evaluator
              • Migration Hub
              • FIS
              • Step Functions
              • Ground Station
              • Pinpoint
          • Account Management, Billing & Support
            • Organizations
            • SCP
            • Control Tower
            • RAM
            • Service Catalog
            • Savings Plan
            • AWS Compute Optimizer
            • Billing and Costing Tools
            • Pricing Calculator
            • Tracking costs in cloud
              • Cost Explorer
            • Monitoring costs in the could
            • AWS Cost Anomaly Detection
            • AWS Service Quotas
            • Trusted Advisor
            • Support Plans
            • Summary
              • Account Best Practices
              • Billing and CostingTools
          • AWS Architecting & Ecosystem
            • General Guiding Principles
            • Well Architected Framework
              • Operational Excellence
              • Security
              • Reliability
              • Performance Efficiency
              • Cost Optimization
              • Sustainability
            • AWS CAF
            • AWS Right Sizing
            • AWS Ecosystem
      • Comparison
        • Region, Availability Zone and Edge Location in AWS
        • EBS vs EFS
    • GCP
    • OCI
    • Object Storage Server
      • MinIO
    • Comparison
      • Azure Active Directory B2C vs AWS Cognito
  • Front End
    • Basic
      • HTML
        • <ul> vs <ol>
        • <table>
      • CSS
        • Padding
        • Box Model
        • Outline
        • Text
        • Display
        • Position
        • z-index
        • Overflow
        • Float
        • Inline vs Inline-block
        • CSS Combinators
        • CSS [attribute] Selector
        • Website Layout
        • Unit
        • CSS The !important Rule
        • Flexbox
        • Comparation
          • div.classname vs div .classname
          • .classname vs .clasname #id vs .classname#id
      • JQuery
        • Syntax
        • Document
      • AJAX
    • Modern Framework
      • React
        • HOC
        • State Management
          • Redux
            • Selector
            • Middleware
              • Saga
              • Thunk
          • MobX
        • Hooks
        • Life Cycle
          • React Lifecycle Methods
          • React Lifecycle Hooks
          • Comparation
        • Signals
      • Angular
        • Directives
          • Component Directives
          • Attribute Directives
            • Built-in
            • Building an Attribute Directive
          • Structural Directives
            • Built-in
            • Custom
        • Binding
        • Components
        • Routing
      • Vue
    • Compile & Module
      • Webpack
      • Babel
    • TypeScript
      • Cheat sheet
    • Blazor
      • WebAssembly
    • UI Library
      • Formik
      • Material UI
      • Tailwind CSS
    • Security
      • Top 7 Common Frontend Security Attacks
    • Some notices
  • Microservices
    • Service Mesh
    • Service Registry
    • Service Discovery
    • Composition
    • Orchestration
    • Transformation
    • Dapr
  • Network
    • Protocols
      • Overview
      • HTTP
      • MQTT
      • AMQP
      • FTP
      • TCP
      • UDP
      • ICMP
    • OSI Model
  • Cache
    • Redis
      • What data should and should not be cached
      • Use cache in
      • Demo in .NET
    • Hazelcast
    • Memcached
  • Message Broker
    • RabbitMQ
      • Demo in .NET
      • Interview Ques
      • Use case
    • Kafka
      • Top 5 Kafka Use Case
    • ActiveMQ
    • Masstransit
  • Bash Script
    • Linux file system
    • Cheat sheet
    • 18 Most-used Linux Commands
    • Interview Question
  • Devops
    • Overview
      • What is ?
      • IaC
      • SAFe
      • Progressive Delivery
        • Blue Green Deployments
        • Canary Deployments
        • A/B Test
      • Platform Engineering
    • Azure Pipeline
    • Docker
      • What is ?
      • Docker Engine
        • Image
        • Docker file
          • Some commands
        • Container
        • Network
        • Volume
          • Additional infomation
      • Docker CLI
      • Docker Compose
        • Additional
      • Docker Security
        • Best Practice
        • Additional Information
      • Docker Swarm
      • Storing
        • Docker Registry
        • Docker Hub
      • Summarize
    • Kubernetes
      • What is ?
        • Additional
      • Kubernetes Pod
      • Replication Controllers
      • ReplicaSets and DaemonSets
        • Additional
      • Kubernetes Services
      • Deployment
        • Additional
      • Volume
      • PersistentVolumes
        • Additional
      • Configuration
        • Additional
      • StatefulSets
        • Additional
      • Downward API
      • Kubernetes internals architecture
      • Pod internal
      • ServiceAccount and Role Based Access Control
      • Network
        • Additional
      • Managing and calculating resources used for Pods
      • Automatic scaling Pods and clusters
      • Advanced scheduling
        • Taints and tolerations
        • Node affinity and Pod affinity
        • Additional
      • Adding custom resource to Kubernetes
    • Openshift
    • IaC
      • Terraform
        • Definition
        • Why chose Terraform?
        • IAC with Terraform
          • Terraform Workflow
            • Terraform Init
            • Terraform Plan
            • Terraform Apply
            • Terraform Destroy
          • Terraform Syntax
        • Terraform Architecture
          • Variable in terraform
          • Variable Type Contraint
          • Terraform Output
          • Terraform Provisioners
        • Terraform State
          • The concept
          • Local and Remote State Storage
          • Persisting Terraform State in AWS S3
          • Hand on
        • Terraform Modules
          • Accessing and Using Terraform Modules
          • Interating with Terraform Module Inputs and Outputs
          • Hand on
        • Built-in Functions and Dynamic Blocks
          • Built-in Function
          • Terraform Type Constraints (Collection & Structural)
          • Terraform Dynamic Block
          • Hand on
        • Terraform CLI
          • Terraform CLI: fmt, taint & import
          • Hand on
            • Practicing Terraform CLI commands(fmt, taint, import)
            • Using Terraform CLI Commands (workspace and state) to Manipulate a Terraform deployment
      • Ansible
    • Jenkin
    • GitOps
      • What is ?
      • Argo CD
    • Monitoring
      • Prometheus and Grafana
      • New Relic
  • Web Server
    • Apache
    • Nginx
    • IIS
  • Security
    • How to prevent crawl data
    • SQL Injection
    • OWASP
      • Web Application Security Risks
        • Broken Access Control
        • Cryptographic Failures
        • Injection
        • Insecure Design
        • Security Misconfiguration
        • Vulnerable and Outdated Components
        • Identification and Authentication Failures
        • Software and Data Integrity Failures
        • Security Logging and Monitoring Failures
        • Server-Side Request Forgery
      • API Security Risks
        • Broken Object Level Authorization
        • Broken Authentication
        • Broken Object Property Level Authorization
        • Unrestricted Resource Consumption
        • Broken Function Level Authorization
        • Unrestricted Access to Sensitive Business Flows
        • Server Side Request Forgery
        • Security Misconfiguration
        • Improper Inventory Management
        • Unsafe Consumption of APIs
    • Security headers
      • HTTP Strict Transport Security (HSTS)
      • Content Security Policy (CSP)
      • Cross Site Scripting Protection (X-XSS-Protection)
      • X-Frame-Options
      • X-Content-Type-Options
      • X-Permitted-Cross-Domain-Policies
      • Public Key Pinning (PKP)
        • What is HTTP Public Key Pinning and Why It’s Not Good to Practice
      • Expect-CT
        • The end of Expect-CT
      • Referer-Policy
      • Pragma
      • Cache-Control
        • Difference between Pragma and Cache-Control headers
      • Same-origin policy
      • Cross-origin resource sharing (CORS)
  • Data Change Capture (CDC)
    • Debezium
  • Software Development Life Cycle (SDLF)
    • Waterfall
    • V Model
    • Agile
      • Methods
        • Xtreme Programming
          • TDD
          • BDD
        • Scrum
        • Kanban
      • Question
  • Secure Software Development Framework (SSDF)
    • Page 1
  • Source Control
    • Git
    • SVN
    • TFS
  • Integration Systems
    • Stripe
    • Salesforce
    • TaxJar
    • Zendesk
  • Enterprise Service Bus (ESB)
    • Mulesoft
  • Data
    • 5 type of analytics
  • SOFTWARE QUALITY STANDARDS – ISO 5055
    • Standard
    • All about ISO 5055
  • Interview Question
    • Overview
      • Roadmap To Clearing Technical Interview
    • Technical
      • DSA
      • System Design
      • C#
      • React
    • Behavior
    • Question back to the interviewer
  • Roadmap
    • .NET
    • Java
  • English
    • Phát âm ed
    • Many vs much
    • Most vs most of vs almost vs the most
    • Quy tắc thêm s,es vào danh từ và cách phát âm s,es chuẩn xác nhất
  • Those will be seen later
    • Note
    • Interview
  • Programming Language
    • Python
      • Data structure
        • Set
    • Javascript
      • Data Structure
        • Map
    • C#
      • Data Structure
        • Value type & Reference type
        • Using statement
        • HashSet
        • Dictionary
        • Priority Queue
      • Fact
        • Understand about IEnumerable vs. IQueryable vs. ICollection vs. IList
        • 5 things you should know about enums in C#
    • Java
Powered by GitBook
On this page
  • What does the term "event" mean in EDA?
  • Why should you use an event-driven architecture?
  • Benefits of an event-driven architecture
  • Event-Driven Architecture Use Cases
  • Examples of Event-Driven Architecture
  • Retail and eCommerce: An Example of Event-Driven Architecture
  • Common Event-Driven Architecture Concepts That You Should Know
  • Event Broker
  • Event Portal
  • Topics
  • Event Mesh
  • Deferred Execution
  • Eventual Consistency
  • Choreography
  • CQRS: Command Query Responsibility Segregation
  • Classification of event-driven architecture
  • Broker topology
  • Meditator topology
  • Handling data loss in event-driven architecture
  • The 6 Principles of Event-Driven Architecture
  • Implement with AWS
  • Implement with Azure
  • Conclusion
  1. Microservices Design Pattern

Event Driven Architecture Pattern

An event-driven architecture uses events to trigger and communicate between decoupled services and is common in modern applications built with microservices. An event is a change in state, or an update, like an item being placed in a shopping cart on an e-commerce website. Events can either carry the state (the item purchased, its price, and a delivery address) or events can be identifiers (a notification that an order was shipped).

Event-driven architectures have three key components: event producers, event routers, and event consumers. A producer publishes an event to the router, which filters and pushes the events to consumers. Producer services and consumer services are decoupled, which allows them to be scaled, updated, and deployed independently.

What does the term "event" mean in EDA?

A change in state is called an event. In an event-driven architecture, everything that happens within and to your enterprise is an event — customer requests, inventory updates, sensor readings, and so on.

Why should you use an event-driven architecture?

The value of knowing about a given event and being able to react to it degrades over time. The more quickly you can get information about events where they need to be, the more effectively your business can react to opportunities to delight a customer, shift production, and reallocate resources.

That’s why event-driven architecture, which pushes information as events happen, is a better architectural approach than waiting for systems to periodically poll for updates, as is the case with the API-led approach most companies take today.

Event-driven architecture ensures that when an event occurs, information about that event is sent to all of the systems and people that need it. It’s a simple concept, but these events have had quite the journey. They need to efficiently move through a multitude of applications written in many different languages, using different APIs, leveraging different protocols, and arriving at many endpoints such as applications, analytics engines, and user interfaces.

If they don’t get there? Connected “things” can’t connect, the applications and systems you rely on fail, and people across your company can’t react to situations that need their attention.

Benefits of an event-driven architecture

Scale and fail independently

By decoupling your services, they are only aware of the event router, not each other. This means that your services are interoperable, but if one service has a failure, the rest will keep running. The event router acts as an elastic buffer that will accommodate surges in workloads.

Develop with agility

You no longer need to write custom code to poll, filter, and route events; the event router will automatically filter and push events to consumers. The router also removes the need for heavy coordination between producer and consumer services, speeding up your development process.

Audit with ease

An event router acts as a centralized location to audit your application and define policies. These policies can restrict who can publish and subscribe to a router and control which users and resources have permission to access your data. You can also encrypt your events both in transit and at rest.

Cut costs

Event-driven architectures are push-based, so everything happens on-demand as the event presents itself in the router. This way, you’re not paying for continuous polling to check for an event. This means less network bandwidth consumption, less CPU utilization, less idle fleet capacity, and less SSL/TLS handshakes.

Event-Driven Architecture Use Cases

The benefits of event-driven architecture covered above are especially relevant in use cases where a single change can have huge consequences, rippling all the way down the chain. One of the most common questions people have is, “When should you use event-driven architecture?” The answer lies in what you are trying to accomplish with your data.

Businesses looking to take advantage of real-time data in their daily activities are turning to event-driven architecture as the backbone for use cases that can benefit the most. According to a 2021 survey, the top 4 use cases for event-driven architecture were:

  • Integrating applications

  • Sharing and democratizing data across applications

  • Connecting IoT devices for data ingestion and analytics

  • Event-enabling microservices

Examples of Event-Driven Architecture

The value of event-driven architecture transcends industries and can be applied to small businesses as well as large multinational corporations. Retailers and banks can use it to aggregate data from point-of-sale systems and across distribution networks to execute promotions, optimize inventory, and offer excellent customer service.

Retail and eCommerce: An Example of Event-Driven Architecture

This is an example of event-driven architecture from a retail perspective. Notice that no systems (inventory, finance, or customer support) are polling to ask if there are any new events; they are simply filtered and routed in real-time to the services and applications that have registered their interest.

Common Event-Driven Architecture Concepts That You Should Know

There are eight key architectural concepts that need to be understood for event-driven architecture to be successful:

  1. Event broker

  2. Event portal

  3. Topics

  4. Event mesh

  5. Deferred execution

  6. Eventual consistency

  7. Choreography

  8. Command Query: Responsibility Segregation

Event Broker

An event Broker is a middleware (which can be software, an appliance, or SaaS) that routes events between systems using the publish-subscribe messaging pattern. All applications connect to the event broker, which is responsible for accepting events from senders and delivering them to all systems subscribed to receive them.

It takes good system design and governance to ensure that events end up where they are needed and effective communication between those sending events and those who need to respond. This is where tooling—such as an event portal—can help capture, communicate, document, and govern event-driven architecture.

Event Portal

As organizations look to adopt an event-driven architecture, many are finding it difficult to document the design process and understand the impacts of changes to the system. Event portals let people design, create, discover, catalog, share, visualize, secure, and manage events and event-driven applications. Event portals serve three primary audiences:

  1. Architects use an event portal to define, discuss, and review events, data definitions, and application relationships.

  2. Developers use an event portal to discover, understand, and reuse events across applications, lines of business, and between external organizations.

  3. Data scientists use an event portal to understand event-driven data and discover new insights by combining events.

Topics

Events are tagged with metadata that describes the event, called a “topic.” A topic is a hierarchical text string that describes what’s in the event. Publishers just need to know what topic to send an event to, and the event broker takes care of delivery to systems that need it. Application users can register their interest in events related to a given topic by subscribing to that topic. They can use wildcards to subscribe to a group of topics that have similar topic strings. By using the correct topic taxonomy and subscriptions, you can fulfill two rules of event-driven architecture:

  1. A subscriber should subscribe only to the events it needs. The subscription should do the filtering, not the business logic.

  2. A publisher should only send an event once, to one topic, and the event broker should distribute it to any number of recipients.

Event Mesh

An event mesh is created and enabled through a network of interconnected event brokers. It’s a configurable and dynamic infrastructure layer for distributing events among decoupled applications, cloud services, and devices by dynamically routing events to any application, no matter where these applications are deployed in the world, in any cloud, on-premises, or IoT environment. Technically speaking, an event mesh is a network of interconnected event brokers that share consumer topic subscription information and route messages amongst themselves so they can be passed along to subscribers.

Deferred Execution

If you’re used to REST-based APIs, the concept of deferred execution can be tricky to comprehend. The essence of event-driven architecture is that when you publish an event, you don’t wait for a response. The event broker “holds” (persists) the event until all interested consumers accept or receive it, which may be sometime later. Acting on the original event may then cause other events to be emitted that are similarly persistent.

So event-driven architecture leads to cascades of events that are temporally and functionally independent of each other but occur in a sequence. All we know is that event A will at some point cause something to happen. The execution of the logic-consuming event A isn’t necessarily instant; its execution is deferred.

Eventual Consistency

Following on from this idea of deferred execution, where you expect something to happen later but don’t wait for it, is the idea of eventual consistency. Since you don’t know when an event will be consumed and you’re not waiting for confirmation, you can’t say with certainty that a given database has fully caught up with everything that needs to happen to it and doesn’t know when that will be the case. If you have multiple stateful entities (database, MDM, ERP), you can’t say they will have exactly the same state; you can’t assume they are consistent. However, for a given object, we know that it will become consistent eventually.

Choreography

Deferred execution and eventual consistency lead us to the concept of choreography. To coordinate a sequence of actions being taken by different services, you could choose to introduce a master service dedicated to keeping track of all the other services and taking action if there’s an error. This approach, called orchestration, offers a single point of reference when tracing a problem, but also a single point of failure and a bottleneck.

With event-driven architecture, services are relied upon to understand what to do with an incoming event, frequently generating new events. This leads to a “dance” of individual services doing their own things but, when combined, producing an implicitly coordinated response, hence the term choreography.

CQRS: Command Query Responsibility Segregation

A common way of scaling microservices is to separate the service responsible for doing something (a command) from the service responsible for answering queries. Typically, you have to answer many more queries than for an update or insert, so separating responsibilities this way makes scaling the query service easier.

Using event-driven architecture makes this easy since the topic should contain the verb, so you simply create more instances of the query service and have it listen to the topics with the query verb.

Classification of event-driven architecture

EDA is classified based on the topology between components in the system, including two popular models: Broker topology and Mediator topology .

Now we will learn about these two models as well as the cases where they should and should not be used.

Broker topology

In the Broker topology, the message stream will be distributed evenly to event processors through the message broker without the need for an event coordination center.

Main components of broker topology

The main components of Broker topology include:

  1. Initiating event : the initial event that starts the entire event stream

  2. Event channel : used to store generated events and deliver those events to a service that responds to them. Event channels can be in the form of topics or queues.

  3. Event broker : contains event channels participating in an event stream.

  4. Event processor : service responsible for event processing

  5. Processing event : is an event created when the state of some service changes and sends a notification to the rest of the system about that state change. This event is sent using the fire-and-forget broadcasting mechanism , meaning it is sent and then does not need to be confirmed whether the sending was successful or not .

Message flow in broker topology

The message flow in the broker topology operates in the following order:

  1. An initiating event is sent to an event channel located in the event broker for processing.

  2. An event processor retrieves that event from the event channel to process and perform specific tasks related to processing that event.

  3. When processing is complete, the event processor sends a processing event to the event channel to notify that the event has been processed.

  4. Other event processors will listen to this processing event and react by creating another processing event. This process repeats until the last event processor has finished processing.

Notice in the message flow, when the event is finished processing, the event processor will always send the broker a processing event to notify that it has completed processing, whether they are consumed or not. If an event has no one listening, it will be ignored.

This may seem like a waste of resources, however, in reality, this is a design that ensures system scalability. The reason is that if the system generates a new business and needs this event, you only need to let the Event Processor listen instead of having to edit the logic in the code.

In case you should use broker topology

  • Need to reduce interdependency (loose coupling) : For systems where components need to operate independently, without knowing about each other, broker topology provides the necessary decoupling capabilities.

  • Simple routing : event processors communicate with each other using events without going through any management intermediary, so it is suitable for systems with simple routing, without needing to ensure the correct order.

In cases where broker topology should not be used

  • Handling complex logic between components : If the system requires handling complex logic, transforming data, or coordinating workflows between producers and consumers, the broker topology may not be flexible enough. active. Mediator topology is often more suitable in this case.

  • Integrate and normalize data from multiple sources : In cases where there is a need to integrate data from various sources with heterogeneous formats and protocols, Broker Topology may not provide enough processing and normalization capabilities data needed.

  • Need for central control and workflow management : If the system needs a high level of central control over event flow and flow management, Broker topology may not be suitable. Mediator Topology, with its central orchestration and management capabilities, may be a better choice in this case.

Meditator topology

In the Meditator topology there is an intermediary component, often called a " mediator ", which is used to coordinate and manage the flow of events between different services or components in the system.

The main components of Meditator topology include:

  1. Initiating event : the initial event that starts the entire event stream

  2. Event queue : stores original events, ensuring they are not lost during processing. Queue helps process events sequentially, ensuring consistency before the event is passed to the Meditator.

  3. Event mediator : the place to coordinate and manage the event flow, is the heart of the Meditator model.

  4. Event channel : similar to broker topology

  5. Event processor : similar to broker topology

How the Meditator topology works is described through the following retail system example:

  • Step 1 : Create order

After receiving the initialization event PlaceOrder, the Meditator creates the event create-order, then sends it to order-placementthe queue. OrderPlacementThe event processor will receive this event, validate the information and create an order, returning to the Meditator a notification of completed processing with the order ID (acknowledment). Depending on the specific business, Meditator can send an event back to the client to notify that an order has been created.

  • Step 2 : Order processing

The Meditator creates and sends 3 events simultaneously, namely email-customer, apply-paymentand adjust-inventoryto the corresponding queues notification, paymentand inventory. The Meditator needs to wait for the event processors to successfully process all events before moving on to step 3.

  • Step 3 : Make the order

Similar to step 2, the events fulfill-orderand order-stocksent to the corresponding queues are order-fulfillmentand warehouse.

  • Step 4 : Delivery

The Meditator notifies customers of delivery readiness status by sending events to queues email-customerand .ship-ordernotificationshipping

  • Step 5 : Notify customers

Notify customers of order status via email using event email-custormer.

In cases where you should use a topology mediator:

  • Needs centralized management : Suitable for systems that require centralized management, requiring tight integration to ensure events are coordinated and processed in the correct order. If the system requires tight controls on data access and security, a mediator topology can provide an additional layer of control.

  • Need to handle complex logic : When the system requires advanced logic processing or event transformations before they are sent to the end consumer. Mediators can perform tasks such as filtering, data transformation, or event mapping.

  • Diverse system integration : When it is necessary to integrate many different systems with heterogeneous protocols and message formats, mediator topology allows data transformation and standardization between systems.

In cases where you should not use the topology mediator:

  • Requires high performance and low latency : Mediator Topology can introduce additional latency due to intermediate processing. In systems that need extremely fast message processing and low latency, adding a mediator may not be appropriate.

  • Need for simplicity and extensibility : If the goal is to build a system that is simple, easy to understand, and easy to extend, adding a mediator can add unnecessary complexity.

  • Separation and independence between components : In systems that require a high degree of separation between components, the use of mediators can create central dependencies, reducing the separability and independence of the components. the components.

  • Fault tolerance and recovery : Mediator becomes the central point that can cause problems. If the mediator crashes, the entire system can be affected. In systems that need high fault tolerance, relying on a central point may not be the best choice.

Handling data loss in event-driven architecture

One of the central issues in EDA is data loss . This error may occur at the following times:

  1. Event processor pushes events into Event channel : Broker error causes data to be lost.

  2. Event channel pushes events to Event Processor : Event processor fails before receiving event, causing data loss.

  3. The event processor stores processed data into the database : the data fails to be saved to the database or the database fails to receive the data.

Data loss at times can be resolved by the following measures:

  1. Synchronous send : Implement Persisted message queues that support guaranteed delivery. When receiving an event, the broker will store data both in memory and in a physical storage such as a filesystem or database. Thanks to that, if the broker fails, when it returns to normal operation, it can completely retrieve events from the physical repository for further processing.

  2. Client acknowledge mode : When an event is retrieved from the queue, it is removed from the queue. However, with client acknowledge mode, the event is not removed from the queue and is assigned a client ID, marking it as consumed, so that no consumer can read it. If Event processor A fails while processing event X, then X still exists in the queue, ensuring data is not lost.

  3. Last participant support (LPS) : Failure to save data to the database can be handled by taking advantage of ACID. If an error occurs when the transaction has been committed, the data will be saved. Events are confirmed after data is successfully saved to the database.

The 6 Principles of Event-Driven Architecture

There we have it, some main principles of event-driven architecture:

  1. Use a network of event brokers to make sure the right “things” get the right events.

  2. Use topics to make sure you only send once and only receive what you need.

  3. Use an event portal to design, document, and govern event-driven architecture across internal and external teams.

  4. Use event broker persistence to allow consumers to process events when they’re ready (deferred execution).

  5. Remember, this means not everything is up-to-date (eventual consistency).

  6. Use topics again to separate out different parts of a service (command query responsibility segregation).

Implement with AWS

Amazon EventBridge is recommended when you want to build an application that reacts to events from SaaS applications, AWS services, or custom applications. EventBridge uses a predefined schema for events and allows you to create rules that are applied across the entire event body to filter before pushing to consumers.

Amazon SNS is recommended when you want to build an application that reacts to high throughput and low latency events published by other applications, microservices, or AWS services, or for applications that need very high fanout (thousands or millions of endpoints). SNS topics are agnostic to the event schema coming through.

Implement with Azure

  • Service bus

  • Event Grid

See more:

Conclusion

Event-driven architectures are a way of designing systems that make your applications more flexible and able to grow without problems across your business. Although this method can bring some new difficulties and complexities, it’s a good way to create complicated applications by allowing different groups to work on their own. Some cloud services even provide managed tools that can help your organization build these kinds of architectures. This guide explains many concepts about event-driven architectures, suggests some best practices, and mentions useful services to assist your development team in making these architectures. Remember, choosing an event-driven architecture isn’t just about technology. To truly get the benefits, you need to change how you think about development and how your team works. Developers will need a lot of freedom to choose the right technology and design for their specific part of the application.

PreviousSidecar PatternNextCQRS (Command and Query Responsibility Segregation)

Last updated 1 year ago

Fig 2. eCommerce Event-Driven Architecture.
Broker topology - Nguồn: Fundamentals of Software Architecture - Mark Richards
Meditator topology - Nguồn: Fundamentals of Software Architecture - Mark Richards
Example of a mediator in a retail system - Source: Fundamentals of Software Architecture - Mark Richards
Data loss in EDA - Source: Fundamentals of Software Architecture - Mark Richards
Measures to handle data loss in EDA - Source: Fundamentals of Software Architecture - Mark Richards

There are two main types of routers used in event-driven architectures: event buses and event topics. At AWS, we offer to build event buses and to build event topics.

Amazon EventBridge
Amazon Simple Notification Service (SNS)
https://learn.microsoft.com/en-us/azure/architecture/guide/architecture-styles/event-driven
https://learn.microsoft.com/en-us/archive/msdn-magazine/2018/february/azure-event-driven-architecture-in-the-cloud-with-azure-event-grid