Community day 2013 applied architectures

41
#comdaybe Applied Architectures Panagiotis “Panos” Kefalidis Windows Azure MVP @pkefal

description

 

Transcript of Community day 2013 applied architectures

Page 1: Community day 2013   applied architectures

#comdaybe

Applied Architectures

Panagiotis “Panos” KefalidisWindows Azure MVP

@pkefal

Page 2: Community day 2013   applied architectures

Who is Panos?

• Panagiotis “Panos” Kefalidis• Founder of VoxVoi• Windows Azure MVP• AZUG Board Member, Azure Insider• Microsoft vTS• [email protected]• @pkefal – www.Kefalidis.me• Add your favorite title here

Page 3: Community day 2013   applied architectures

Setting the expectations

• You will not –See code–Find an answer to everything

• You will–Get a better understanding of what applies on

Windows Azure–You will see real architectures we propose to

customers–You will see applied techniques of specific products

Page 4: Community day 2013   applied architectures

Now that everybody is excited..

Page 5: Community day 2013   applied architectures

Finding the right serviceSmall checklist

Page 6: Community day 2013   applied architectures

It can be like that..

Page 7: Community day 2013   applied architectures

Poor man’s checklist - Messaging

• Do you need transactions?• Do you need bigger messages?• Do you have specific scalability targets?• Does it have to be cost effective vs

performance?• Do you need interoperability out-of-the-box?

Page 8: Community day 2013   applied architectures

Poor man’s checklist – Front-end apps

• Do you need fast deployments?• Do you need easy tests of prototypes?• Do you need CI out-of-the-box?• Do you need special software to make your

web app run?• Do you need session state on the web app?

Page 9: Community day 2013   applied architectures

Poor man’s checklist – PaaS vs IaaS

• Do you need installs longer than 30 mins?• Do you need persistence on the disk itself?• Fulfill your requirement by automating an

install/customization during startup?• Persistent disks mounted on OS level, not

app level?• Guaranteed IOPS per disk?

Page 10: Community day 2013   applied architectures

Poor man’s checklist – Security/Connectivity• Do you need identity federation?• Two factor authentication on your portal?• Graph API to discover objects in your

directory?• Private IPs and ACLs on public endpoints?• Secure connection on-premise to cloud?• Choose your own internal VIPs

Page 11: Community day 2013   applied architectures

Many services, different roles

• Windows Azure Service Bus• Windows Azure Storage Queues• Windows Azure IaaS• Windows Azure Virtual Network (VNET)• Windows Azure VPN • Windows Azure _we_can_go_on_forever

Page 12: Community day 2013   applied architectures

Some alternatives

• MongoDb – Offered on Windows Azure through the Store

• Redis – Offered with a ready to use script for deployment

Page 13: Community day 2013   applied architectures

MongoDb

• Document based database• Still has queries, secondary indexes etc.• Alternative to Windows Azure Tables• Less hassle to do stuff• Automatic capabilities (scaling, sharding and

others)• Much more expensive though

Page 14: Community day 2013   applied architectures

Redis

• In memory database (key value pairs)• Insanely fast• It can be queried • Highly available if you set it up correctly• It has Windows Azure Support from Microsoft

OSS

Page 15: Community day 2013   applied architectures

Redis

• You can do Pub/Sub• You can have transactions• You can have distributed locks out of the box.– Increment counters from multiple threads etc.

Page 16: Community day 2013   applied architectures

Redis vs Windows Azure Role Cache

• Redis is faster• Redis can be queried (real queries, not tags)• Redis has smaller footprint• Redis can be deployed and be connected

cross-DC• Redis can be access from the outside world if

necessary

Page 17: Community day 2013   applied architectures

Redis vs Windows Azure Role Cache

• Redis can persist data as well– It’s recommended to do AOF and only on Slaves

• Windows Azure Role Cache is cheaper–You need dedicated roles on Redis to have performance

• It’s that tiny easier to enable Windows Azure Role Cache

• You don’t have to maintain anything yourself on Windows Azure Role Cache

Page 18: Community day 2013   applied architectures

Things to remember as wellVisiting a customer

Page 19: Community day 2013   applied architectures

During your first meeting..

Page 20: Community day 2013   applied architectures

Source of problems

• Legacy• Interoperability• 3rd party vendor software• Custom software• Company policies and human factor

Page 21: Community day 2013   applied architectures

Legacy

• Legacy technologies– .NET 1.1, Windows 2000, Windows 2003, Exchange 2003

• Legacy mindset– 80s approach on problems e.g. synchronous operations– Adding hardware to solve performance issues

• Legacy deployment models/tools–Out-dated tools, like SourceSafe–Continuous integration vs Manual deploy– Paper work

Page 22: Community day 2013   applied architectures

Interoperability

• Existing integration–Tightly coupled integration between systems–Bad implementations/practices on Enterprise Service

Bus

• Out-dated technology–Old tools and implementations–Different implementations for each platform

(.NET/JAVA)–No cloud support (PaaS model)

Page 23: Community day 2013   applied architectures

3rd party vendor software

• No cloud readiness–Unattended installs for PaaS support– Sticky sessions– In-memory state/cache– File system persistence

• Unwillingness– To fix the issues

• Willingness– To sell new versions instead

Page 24: Community day 2013   applied architectures

Custom software

• Not cloud ready– Same problems as the vendors

• Developers not trained–No experience with HA systems–No experience with de-coupled architectures–No experience with asynchronous operations– Learn how to embrace failure

• Developers get offended– A significant mindset change causes denial

Page 25: Community day 2013   applied architectures

Finding who is responsible…

Page 26: Community day 2013   applied architectures

Examples of architecturesTo the real stuff

Page 27: Community day 2013   applied architectures

Example 1

Page 28: Community day 2013   applied architectures

Read Only AD

Replication (VPN)

Load Balancer

Customer HQ

VPN

Page 29: Community day 2013   applied architectures

Distributed cache

Read Only AD

Office 365

WA Storage

WA SQL DB

Page 30: Community day 2013   applied architectures

Service Bus

Meter 1 Meter 2

Meter 1 Meter 2

Service BusPolling Polling

Country 1

Country 2

Filter

Filter

Polling

Polling

Message processing

Page 31: Community day 2013   applied architectures

Example 2

Page 32: Community day 2013   applied architectures

Legend

End-UserWeb Site

Moderator Web Site

End-User

Blob Storage

(Uploaded Content, Generated Mezzanine File, Thumbnails, Streaming Content, Message Queues, Encoding profiles)

Content structure:

/{CAMPAIGN}/{USER}/{DATE}/ORIGINAL_FILE/{FILE_NAME} /{CAMPAIGN}/{USER}/{DATE}/METADATA/{FILE_NAME} /{CAMPAIGN}/{USER}/{DATE}/MEZZANINE_MASTER/{FILE_NAME} /{CAMPAIGN}/{USER}/{DATE}/THUMBNAILS/{FILE_NAMES} /{CAMPAIGN}/{USER}/{DATE}/STREAMING/{SEGMENTS} /{CAMPAIGN}/EncodeProfiles/{NAME}.xml

UPLOADED QUEUE

7. Read Message from Queue

Media Services

DONE/ARCHIVE QUEUE

Orchestrator

SQL Server

(Metadata & Status)13. Update Publish State (Success)

13. Update Publish State (Error)Customer mod

ERROR QUEUE

11. Put Message on Queue12. Read Message from Queue

9. Put message on Queue10. Read message from Queue

Azure

APPROVE QUEUE

1. View All Content3. View Details (Item)

5. Approve (Item)

2. Fetch Metadata

4. Fetch Tumbnails

6. Put Message on Queue

Customer @͛s publishing system

8. Execute Job

10. Return Success10. Return Error

PUBLISHED QUEUE 11. Put Message on Queue12. Read Message from Queue

Customer @͛s media platform

Customer

9. File Drop

2. Upload video

1. Upload video3. Put message

on Queue

4. Read Message from Queue

7. Create Job

9. Read Success8. Read Error

5. Create video record with metadata10. Update video metadata

11. Update video metadata (Error). Needs admin attention

7. Drop final file

11. Put message into Queue

6. Read job metadata(encode profile .xml)

Admin flow

User Flow

Page 33: Community day 2013   applied architectures

Example 3

Page 34: Community day 2013   applied architectures

Startup scripts automation

• We connect to a service and get a SAS• We use that to securely access storage• We download JDK, JBoss and EAR/WAR• Unzip/install as necessary• Continue with other tasks

Page 35: Community day 2013   applied architectures

Worker Role IaaSWeb Role

abstraction control

WR1

Proxy

WR2

JBoss AS 7 AP+AA

JBoss AS binariesJBoss configurationEAR(s) and WAR(s)

Page 36: Community day 2013   applied architectures

Moving JBoss to Windows Azure

• jGroups discovery uses PING• mod_cluster discovery by advertising• Both are multicast protocols• Multicast is not supported on Windows Azure

Page 37: Community day 2013   applied architectures

PING solution

We implemented “AZURE_PING” as a jGroups protocol

Page 38: Community day 2013   applied architectures

mod_cluster solution

Azure advertising AA

Proxy

JBoss AS 7 AA

Proxy

JBoss AS 7 AA

Proxy

JBoss AS 7 AA

Metadata

-----------------------------------------------

--

Read metadata

Page 39: Community day 2013   applied architectures

Proxy

JBoss AS 7AA

WR1

WR2

Proxy

JBoss AS 7AA

Proxy

JBoss AS 7AA

JBoss AS 7AA

JBoss AS 7AA

JBoss AS 7AA

JBoss AS 7AA

Scaling

Page 40: Community day 2013   applied architectures

Results

• Highly scalable JBoss clustered solution• We have state if we need it• They can add/remove instances –Helps them reach their cost targets

• Easy upgrades using VIP SWAP• Easy deployment of new packages– Just restart the instance, the script will do the

rest

Page 41: Community day 2013   applied architectures

Anything to ask?