2. Enter Text
Why Cloud Design Patterns?
Availability & Resilience are hard in Cloud.
Performance and scalability are taken for granted in cloud.
Data management not a trivial Problem.
https://blogs.karthikeyanvk.in
3. Enter Text
Why Cloud Design Patterns?
It provides Off-the-shelf solution.
Automatically handles quality attributes.
https://blogs.karthikeyanvk.in
4. Enter Text
What is Design Patterns ?
Design patterns are typical solutions to common problems in
software design.
Each pattern is like a blueprint that you can customize to solve a
particular design problem in your code.
https://blogs.karthikeyanvk.in
13. Enter Text
Cloud Design Principles
https://blogs.karthikeyanvk.in
Design for self healing.
Make all things redundant
Design to scale out
Partition around limits
Design for operations- Deployment, Monitoring, Incident
response, Auditing
14. Enter Text
Cloud Design Principles
https://blogs.karthikeyanvk.in
Design for Evolution.
Use the best data store for the Job
Build for the business needs. Think YAGNI
15. Enter Text
CQRS Pattern
Command Query Responsibility Segregation.
Command – Create/Update/Delete
Query – Select or Fetch
https://blogs.karthikeyanvk.in
17. Enter Text
Strangler Pattern
Incrementally migrate a legacy system by gradually replacing
specific pieces of functionality with new applications and
services.
https://blogs.karthikeyanvk.in
19. Enter Text
Pipes and Filters pattern
Decompose a task that performs complex processing into a series
of separate elements that can be reused.
The processing required by an application can easily be broken
down into a set of independent steps.
Keep your classes DUMB
https://blogs.karthikeyanvk.in
21. Enter Text
Circuit Breaker Pattern
https://blogs.karthikeyanvk.in
Handle faults that might take a variable amount of time to
recover from, when connecting to a remote service or resource.
Three States – Open, Half-Open, Closed State.
Use POLLY – nugget package to implement. Straight forward
solution.
23. Enter Text
Compensating Transaction Pattern
https://blogs.karthikeyanvk.in
Undo the work performed by a series of steps, if one or more of
the steps fail.
A compensating transaction is application specific.
Used in places where there is an eventual consistency
Solves the No-SQL world problem with different data store in
Microservices
24. Enter Text
Compensating Transaction Pattern
https://blogs.karthikeyanvk.in
Used in places where there is an eventual consistency
Solves the No-SQL world problem with different data store in
Microservices
25. Enter Text
Static Content Hosting
https://blogs.karthikeyanvk.in
Deploy static content to a cloud-based storage service that can
deliver them directly to the client.
This can reduce the need for potentially expensive compute
instances.
27. Enter Text
Static Content Hosting
https://blogs.karthikeyanvk.in
May not be suitable in application that needs to perform some
processing on the static content before delivering it to the client.
For example, it might be necessary to add a timestamp to a
document
30. Enter Text
Event Sourcing Pattern
https://blogs.karthikeyanvk.in
Instead of storing just the current state of the data in a domain,
use an append-only store to record the full series of actions
taken on that data.
The events are persisted in an event store that acts as the system
of record (the authoritative data source) about the current state
of the data.
35. Enter Text
Sidecar Pattern
https://blogs.karthikeyanvk.in
Deploy components of an application into a separate process or
container to provide isolation and encapsulation.
Applications and services often require related functionality, such
as monitoring, logging, configuration, and networking services
39. Enter Text
Why Anti-Patterns ?
Application behaves well during all types of testing. But behaves
badly in production.
The development team is then faced with two questions:
• Why didn't this behaviour show up during testing?
• How do we fix it?
https://blogs.karthikeyanvk.in
40. Enter Text
What is Anti-Patterns ?
Anti-Pattern is a common practice that is likely to cause problems
when an application is under pressure.
It's very difficult in a test environment to simulate real users.
https://blogs.karthikeyanvk.in
41. Enter Text
Busy Database Anti-Pattern
Offloading processing to a database server can cause it to spend
a significant proportion of time running code.
Remember stored procedures and triggers !
https://blogs.karthikeyanvk.in
42. Enter Text
No Caching Anti-Pattern
Repeatedly fetching the same information from a resource that is
expensive to access, in terms of I/O overhead.
Also think about stale data
Remember the expiring cache. Absolute or Sliding expiration.
Monitor your application and queries
https://blogs.karthikeyanvk.in
43. Enter Text
Chatty I/O Anti-Pattern
The cumulative effect of a large number of I/O requests can have
a significant impact on performance and responsiveness.
Packaging the data into larger, fewer requests
Problem seen in improper domain division in Microservices.
https://blogs.karthikeyanvk.in
44. Enter Text
Improper Instantiation Anti-Pattern
It can hurt performance to continually create new instances of an
object that is meant to be created once and then shared.
Think about singleton pattern.
Always reuse System.Net.Http.HttpClient or any connection
related broker classes
https://blogs.karthikeyanvk.in
45. Enter Text
References
@karthik3030
• https://code-maze.com/liskov-substitution-principle/
• https://medium.com/@domagojk/patterns-for-designing-flexible-architecture-in-node-js-cqrs-
es-onion-7eb10bbefe17
• http://cloudgirl.tech/data-partitioning-vertical-horizontal-hybrid-partitioning/
• https://docs.microsoft.com/en-us/azure/architecture/patterns/
https://blogs.karthikeyanvk.in
46. Enter Text
Networking and more
@karthik3030
• https://www.facebook.com/aspiringDotnetArchitects/
• https://www.meetup.com/Chennai-Microsoft-Azure-User-Group/
• https://www.youtube.com/channel/UCJxa58lDcDj4tYQIHh7ORxA
https://blogs.karthikeyanvk.in
a natural law like gravity. It’s different than a value. Values are subjective; principles are objective. Gravity… if you drop something, gravity controls
a natural law like gravity. It’s different than a value. Values are subjective; principles are objective. Gravity… if you drop something, gravity controls
Use partitioning to work around database, network, and compute limits
Use partitioning to work around database, network, and compute limits
This pattern may not be suitable:
When requests to the back-end system cannot be intercepted.
For smaller systems where the complexity of wholesale replacement is low.
Testing problem.
Design your class to be dumb
Design your class
to be dumb
Complexity.
Idempotency.
Repeated messages.
Think of poison queue
Exception handling and failing should be properly thought through..
Logging should be made proper and don’t log toomuch
This pattern isn't recommended:
For handling access to local private resources in an application, such as in-memory data structure. In this
environment, using a circuit breaker would add overhead to your system.
As a substitute for handling exceptions in the business logic of your applications.
Product and order example
Product and order example
Where is your angular application deployed in azure ?