Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Modern Arch. Patterns for the cloud

No description
by

Mahesh Krishnan

on 9 August 2013

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Modern Arch. Patterns for the cloud

Modern Architectural Patterns
for the cloud

What is the cloud?
Computing power/storage over the internet, provided as a service. Benefits include:

Zero or low upfront cost
Elasticity on demand (Scale up or down)
Lower $
High availability/reliability
Maintenance/upgrades/patches etc is someone else's problem
Seemingly infinite computing power at your disposal
Introduction
Arch. Characteristics
Design for failure (resilience)
Design for availability
Design for elasticity
Design for the future
Classic layered
approach
Deployment
Classic patterns
Conventional Design
ASP NET MVC or Web Forms
WS-* web services
SQL Server database
...
Demo App for this talk!
Create an app better than Twitter!
Cloud scale!!



CQRS
Event Sourcing
Eventual consistency
Queue Centric Workflow
Other Patterns
Modern
Patterns

Command Query Responsibility Separation
Command
Query
Performs an action
The "Write" part of CQRS
In the CAP theorem, offers Consistency and Availability
No Read functionality: domain model offers true encapsulation
Domain model only exposes behaviours
Returns data to the user through a query
"Read" part of CQRS
In the CAP theorem, offers Availability and Partitionability
Can skip the domain model altogether - thin read layer
Reads can go direct to DB - No complexity
Reads are quick
An intro
Event sourcing:
A way of persisting app state, by storing history of events
Event:
Something that has happened in the past
Examples:
Chess application: storing every move that was made as a series of events
Accounting application: storing every payment made, every payment received as events
Can get the state of the application, by replaying events
The old way
Create Shopping Cart
Add book "Introducing .NET 4.5"
Add book "SL 4 for Dummies"
Checkout cart
The new way
Shopping Cart has been created
Book "Introducing .NET 4.5" has been added
Book "SL 4 for Dummies" has been added
Cart has been checked out
BASE, not ACID
Relational database do not scale well
Enter....No SQL Databases
Isolate units of work and execute them asynchronously
"Commands" are queued up
Multiple instances can work on a queue (scaling)
Gotchas:
Money Leak
Idempotent processing of repeated messages
Poison message handling
Application
Query
(Read)
Command
Complex
Business
Logic
(Write)
Id
User
...
Id
CartId
Isbn
...
Xx Joe ...
1 Xx Blah1 ...
2 Xx Blah2 ...
More updates
How it all hangs together
Introducing.....
WhingePool
Shopping cart Data
created
Event ...
Book 1 added Data
Book 2 added Data
Cart checked Data
out
Put/Post
Web App
Get
Azure
Website
Command Queue
Command
Processor
Command
Handler
Materialized
Views
Event
Store
Query
@MaheshKrishnan
Mahesh.Krishnan@readify.net

In the Microsoft Eco-system
NosQL Databases
Non-relational data that has no fixed schema
Highly scalable, and performant
Eventually consistent - BASE/not ACID
Stores Partitioned key-value pairs in tables
Examples - Google's BigTable, Azure's Table Storage, Amazon's DynamoDB, Redis, etc
Document DBs
Stores Documents in datastores
Documents can be XML, JSON, BSON, etc
Examples - Raven, Mongo, Couch
Graph DBs
Works on "Graph theory" concept. Stores data as Nodes, Properties and Edges
Examples - Neo4J, Allegro, Virtuso
Key-Value pairs
BASE
Data is always available, even if data is stale.
Basically Available
Soft State
Eventually consistent
State may change.
There may be a delay before the final state is reached. But, it will.
Map Reduce
Pattern to deal with Big Data. Azure uses Hadoop (HD Insight)
Data is processed in 2 steps:
Map: Data is divided up into sub-problems and distributed to nodes. Nodes will process and deliver answer
Reduce: Takes the answers of sub-problems and combines them to form eventual answer
Can repeat Map/Reduce multiple times to get the answer you need
Microservices
Concept of breaking down services to be small enough so that they can be independently deployed, and versioned
Rather than have one or two monolithic services, you end up with a large set of "micro" services
Sacrifices performance for flexibility - but that can be remediated
Document
enrichment
In a workflow environment, a document can move from one step to another
Document enrichment can be used to embellish the document at each step to make it more meaningful and useful for next step
Example - Doing a payrun
@JohnAzariah
John.Azariah@myob.com

Application
Query
Command
Queue
Processing
Database
Full transcript