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 Cloud (VIC.NET presentation)

No description
by

Mahesh Krishnan

on 6 December 2013

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Modern Arch Patterns for Cloud (VIC.NET presentation)

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
Re-cap
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 Segregation
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 Partition tolerance
Can skip the domain model altogether - thin read layer
Reads can go direct to DB - No complexity
Reads are quick
The basics
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 "C# in a nutshell"
Remove book "C# in a nutshell"
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 "C# in a nutshell" has been added
Book "C# in a nutshell" has been removed
Book "SL 4 for Dummies" has been added
Cart has been checked out
Already use eventual consistency
Relational database do not scale well horizontally
BASE better than ACID in some cases
Enter....NoSQL Databases
Isolate units of work and execute them asynchronously
"Commands" are queued up
Multiple workers can operate on a queue (scaling)
Can have dynamic command handlers
Design considerations:
Idempotency
Transaction consistency
Poison message handling
Money leak
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 Cart Data
created
Event ...
Book added Book 1 Data
Book added Book 2 Data
Cart checked Checkout 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 (horizontal)
Performance benefits
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 to obtain results for embarrassingly parallel problems
Azure uses Hadoop (HD Insight)
Data is processed in several steps:
Store: Split and store data in multiple nodes
Map: Data is divided up into sub-problems and distributed to nodes. Nodes will process in parallel and deliver answer
Shuffle: Result is parallel sorted in some order
Reduce: Takes the shuffled answers of sub-problems and combines them to form eventual answer
Take code to data to avoid latency & other issues
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
Users
Presentation Layer
Domain Layer
Data Access Layer
Security
Op. Mgmt
Comms.
Load Balancer
Client Tier
Application Tier
Data Tier
Active Passive Cluster
Shared Data
Cart
Cart Items
3 Xx Blah3 ...
Book added Book 3 Data
Book removed Book 2 Data
Application
Query
Command
Complex
Business
Logic
Materialized
View
Data Store
Full transcript