building cloud native software
DESCRIPTION
To really take advantage of cloud, software must be optimized to run in the cloud. This presentation explores what it means to be "Cloud Native" and looks at a real open source project that has built a complete Cloud Native platform. Cloud is not just a better way to run existing software, there are core enhancements that need to be made to software to enable it to run really effectively in a cloud environment. Often the first thought is about massive scalability, but actually there are other key enablers: multi-tenancy, metering, dynamic distribution, self-service and incremental deployment and testability. This presentation explores these enablers and looks at how an Open Source project (Carbon) built on Apache technology was re-built to be cloud native. The presentation will cover not just the concepts but dive into the practical issues in making a cloud native system and also explore which Apache technologies can help along the way.TRANSCRIPT
![Page 1: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/1.jpg)
Building Cloud Native Software
Navigating the waters of a cloudy infrastructure
Paul FremantleCTO and Co-Founder, WSO2
VP, Apache SynapseASF Member
@pzfreo http://pzf.fremantle.org
![Page 2: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/2.jpg)
http://www.flickr.com/photos/ladymaggic/
![Page 3: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/3.jpg)
http://www.flickr.com/photos/jurvetson/
![Page 4: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/4.jpg)
One view of Cloud Applications today
VM
App
VM VM
App
![Page 5: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/5.jpg)
What’s wrong with this picture?
![Page 6: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/6.jpg)
Cloud computing in one page
The Big Picture• Infrastructure as a Service
– Servers, storage & networking– For infrastructure specialists
• Platform as a Service– Middleware and Core Services– For developers, integrators, architects
• Software as a Service– Applications– For end-users
![Page 7: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/7.jpg)
© WSO2 2010
Enterprise IT in 2010
7
![Page 8: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/8.jpg)
© WSO2 2010
Enterprise IT in 2015+
8
![Page 9: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/9.jpg)
So how do you get into the water?
http://www.flickr.com/photos/csessums/
![Page 10: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/10.jpg)
Elasticity
http://www.flickr.com/photos/clanlife/
![Page 11: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/11.jpg)
Why do people choose Cloud?
• Usually provisioning time is much more important than elasticity
• Some companies take 3-6 months to provision an application
![Page 12: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/12.jpg)
Self-Service
• Provision your company / dept • Provision your application• Provision integration• Provision users• Provision a portal• Provision storage• Provision queues• Etc
![Page 13: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/13.jpg)
How do you effectively provision systems?
• They should be multi-tenant
• Why?– Per instance cost is very small
• Unless the instance is used– Better shared resources– Infinitely simpler management
![Page 14: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/14.jpg)
So far
• (Elastic)• Self-Service• Multi-tenant
![Page 15: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/15.jpg)
Elasticity
• Yes you can (sometimes) rely on the IaaS– E.g. Amazon
• But ultimately we will want to provide more intelligent elasticity– E.g. Coach/Business/Private Jet– Or based on market pricing– Or……
• Elasticity requires the underlying code to be “distributed”
![Page 16: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/16.jpg)
So…..
• You have an elastic, self-service, multi-tenant runtime
• What next?
![Page 17: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/17.jpg)
Money (aka Metering and Billing)
http://www.flickr.com/photos/amagill/
![Page 18: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/18.jpg)
Metering
• For many businesses, internal billing hasn’t been successful– That will have to change!
• Metering is very important– And overall system, service and tenant
monitoring
![Page 19: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/19.jpg)
Monolithic is back!!!!
• And, no, that isn’t good!
![Page 20: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/20.jpg)
Wiring!
• You’ve heard plenty about wiring from Tuscany
• Wiring is really important in any large application
• Dynamic wiring for the Cloud
![Page 21: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/21.jpg)
Dynamic Discovery
http://www.flickr.com/photos/unc-cfc-usfk/
![Page 22: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/22.jpg)
Discovering other services?
• Registry – for long term metadata• WS-Discovery – for “who is where now?”
– “aka Discovery Proxy”• Probe (types, scope)• ProbeMatch <- UUID• Resolve(UUID)• ResolveMatch <- Transport Address
![Page 23: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/23.jpg)
Incremental deployment and test
• Co-deploy version 5.5.4 next to 5.5.3– Implies versioned
• Test in place• Partially switch 5% of live traffic over• Monitor CPU and Memory usage
– And billing!• Switch the rest over• Revert
![Page 24: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/24.jpg)
“Cloud Native”
• Self-service• Distributed and Elastic • Multi-tenant• Metered and Billed• Dynamically wired • Versionable, Incrementally deployable and
testable
![Page 25: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/25.jpg)
A case study – “Stratos”
• A full middleware platform• Based on OSGi• Self-service• Multi-tenant, Elastic, Metered and Billed• Partial versioning, dynamic discovery• Distributed but not yet endlessly scalable• Available under the Apache License
– Heavily based on Apache projects• Tomcat, Axis2, Synapse, ODE, Shindig, Abdera, Commons, etc• Looking at Cassandra, QPid, etc
![Page 26: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/26.jpg)
Carbon
![Page 27: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/27.jpg)
Home page
![Page 28: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/28.jpg)
First steps
• Identity (and hence Multi-Tenancy)– Every domain/tenant has its own single-sign on
and identity manager– Based on LDAP – which is inherently multi-
tenant– Supporting SAML2, OpenId, OAuth, XACML,
Infocard, WS-Trust
![Page 29: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/29.jpg)
Next step – Registry/Repository
• Added a tenant id column to every database in our registry/repository schema
• Used to store:– Permissions– Metadata / Configuration– Code– The works
![Page 30: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/30.jpg)
Next step
• Security management– Using Java and OSGi security managers to isolate
tenants– Come hear my talk on making Tomcat Multi-
tenant tomorrow!
![Page 31: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/31.jpg)
Billing and Metering
• A generic multi-tenanted metering and billing module
• Written as OSGi• Uses Drools to implement service levels
– E.g. 10 users, 100Mb transfer/month, 15 deployed services for free level of subscription
• Can be used to meter real business events– How many sales transactions / month
![Page 32: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/32.jpg)
Elasticity
• Elastic Load Balancer– Apache Synapse
• Always done load balancing• Now has full transparent HTTP support• Has “Autoscale” mediators
– Based on Azeez’s Master’s thesis• Priority Execution support and throttling (Business
Class)– Underlying Cloud API
• We have based on Amazon/Eucalyptus/Ubuntu API• Adding support for vmWare underneath
![Page 33: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/33.jpg)
Distributed
• Our distribution model is based on Apache Tribes
• Adjusted Tribes to support WKA model• In a large cloud (e.g. Amazon) you cannot
rely on subnet communications between nodes
• Nominate two Well Known Addresses– Tribes contacts the WKA and uses that the
bootstrap the fabric
![Page 34: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/34.jpg)
Versioning and incremental behaviour
• OSGi• We have a simple deployment model (CAR)
– Each CAR consists of stuff• Webapps, ESB flows, BPEL, Registry entries, etc• Simple XML syntax is used to wrap everything as OSGi• Each Bundle has a version
![Page 35: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/35.jpg)
Dynamic Wiring
• A complete Governance Registry per tenant• Supports WS-Discovery seamlessly
– i.e. supports both long-lived metadata and presence
• Not finished yet
![Page 36: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/36.jpg)
Quick demo
![Page 37: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/37.jpg)
Still to do
• Lots– Multi-tenant services
• Log, Cache, Data, …– Better support for incremental deployment and
test– Better support for coach/business/private jet– Extreme scale
![Page 38: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/38.jpg)
“Cloud Native”
• Self-service• Distributed and Elastic • Multi-tenant• Metered and Billed• Dynamically wired • Versionable, Incrementally deployable and
testable
![Page 39: Building Cloud Native Software](https://reader033.vdocument.in/reader033/viewer/2022061117/5457ec4daf795995778b4c08/html5/thumbnails/39.jpg)
Summary
• Cloud Native attributes distinguish code that just floats on top of the cloud from applications that live in the cloud
• This actually applies to Infrastructure (IaaS), Platform (PaaS) and Applications (SaaS)
• Stratos is an example of a making an OSGi system Cloud Native
• Read my blog entry on this:– http://bit.ly/CloudNative