Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web...
-
Upload
thomas-witt -
Category
Technology
-
view
3.283 -
download
0
description
Transcript of Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web...
![Page 1: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/1.jpg)
AWS Tech Summit for Developers and ArchitectsBerlin, 2011-05-16
Lessons Learned fromConverting a Web Application
to Multitenancy and Deploying it toAmazon Web Services
using Scalarium
![Page 2: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/2.jpg)
http://twitter.com/thomas_witt
Thomas Witt
@thomas_witt
![Page 3: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/3.jpg)
![Page 4: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/4.jpg)
http://www.infopark.de/
Since 1997 …
Director Product & Business Development
![Page 5: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/5.jpg)
Great Websites run InfoparkFounded in 1994 in Berlin
CMS, CRM and Online Marketing Software
Large Websites for Enterprises
![Page 6: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/6.jpg)
http://www.infopark.de/references
References
![Page 7: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/7.jpg)
http://www.infopark.de/references
References
infopark.de/references
![Page 8: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/8.jpg)
What are we going to learn …
Why did Infopark move to «The Cloud»™?
How did we do it?
What did we learn from it?
![Page 9: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/9.jpg)
Why?(You will be cloudified. Resistance is futile.)
![Page 10: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/10.jpg)
![Page 11: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/11.jpg)
Enterprise Software Installation sucks.
![Page 12: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/12.jpg)
http://www.alexa.com/siteinfo/cortalconsors.de
![Page 14: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/14.jpg)
http://www.alexa.com/siteinfo/munich-airport.de
![Page 15: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/15.jpg)
Modern Web-Sites have to be cloud
based.
![Page 17: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/17.jpg)
Multitenancy(Yes, we scale!)
![Page 18: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/18.jpg)
“
http://en.wikipedia.org/wiki/Multitenancy
Multitenancy refers to a principle in software architecture where a single instance of the software runs on a server, serving multiple client organizations (tenants).
![Page 19: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/19.jpg)
Enabling Multitenancy
Create a "shared nothing" architecture
Move all configuration into the database
Extract background tasks
Choose database tenantwise
![Page 20: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/20.jpg)
Implementing DB switching is easy
tenant = request.host.split('.').first
begin @@db ||= CouchRest.database(tenant)rescue raise "tenant name '#{tenant}' doesn't exist"end
![Page 21: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/21.jpg)
SaaS Cluster
AZ 3AZ 2AZ 1
System Architecture Fiona on SaaS
EC2: Fiona, OMC, DB, Search
EC2: Fiona, OMC, DB, Search
EC2: Fiona, OMC, DB, Search
EC2: Fiona, OMC, DB, Search
EC2: Fiona, OMC, DB, Search
EC2: Fiona, OMC, DB, Search
Elastic Load Balancing: *.saas.infopark.net
Scalarium
S3: Assets (Blobs)
SES:E-Mail
DB Backup Server
Redis/Resque
CustomerAZ 1 AZ 2
EC2:Rails,
DB Replica
EC2:Rails,
DB Replica
Elastic Load Balancing:customer.com
S3
+CloudFrontCDN
GitHub
Hoptoad
New Relic
![Page 22: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/22.jpg)
http://broadcast.oreilly.com/2011/04/the-aws-outage-the-clouds-shining-moment.html
Use multiple Availability Zones!
![Page 23: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/23.jpg)
Database(Choose wisely)
![Page 24: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/24.jpg)
Problems with SQL databases in the cloud
Bottleneck
Doesn‘t scale
Single point of failure
Adding new Replicas
Consistent backups
Recovery times after crashes
![Page 25: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/25.jpg)
SQL databases are not built for the
cloud.
![Page 26: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/26.jpg)
http://en.wikipedia.org/wiki/CAP_theorem
NoSQL databases ARE built for the
cloud.… by trading off consistency for partition tolerance
![Page 27: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/27.jpg)
http://couchdb.apache.org/
Database backend
Advantages
Simple handling
Better replication
Stability and reliability
Schemaless
Lots of flavours
CouchDB/BigCouch, SimpleDB, MongoDB, …
We have chosen BigCouch.
![Page 28: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/28.jpg)
Automatize!(Scalarium is your friend)
![Page 29: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/29.jpg)
![Page 30: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/30.jpg)
http://www.opscode.com/chef/
Your server – à la carte
![Page 31: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/31.jpg)
Auto Healing (and scaling)
![Page 32: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/32.jpg)
http://www.scalarium.com/
Automatize using Scalarium
Automated Machine Installs
No hassle with AMI Images
Always install from scratch
Using Chef Recipes
Monitoring and Scaling
Auto Healing
Time Based Scaling
Load Based Scaling
![Page 33: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/33.jpg)
Security(… there's lots of interesting data in the cloud)
![Page 34: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/34.jpg)
https://aws-portal.amazon.com/gp/aws/developer/account/
Have multiple AWS accounts
![Page 35: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/35.jpg)
IAM
![Page 36: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/36.jpg)
![Page 38: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/38.jpg)
![Page 39: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/39.jpg)
Security is important!
Have multiple AWS accounts
Use IAM• Rotate your keys• Use an MFA Device• Lock up your master account
Clear concept how to handle policies, accounts, groups
Have lots of Account/Key Pairs with restricted access
Automatize everything• Security Groups• Regular Firewall checks• Account creation / deletion
![Page 40: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/40.jpg)
People(The Human Factor)
![Page 41: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/41.jpg)
![Page 42: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/42.jpg)
“I don't «own» my data anymore.
![Page 43: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/43.jpg)
“What about data privacy?
![Page 44: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/44.jpg)
“Is your security good enough?
How can I trust you?
![Page 45: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/45.jpg)
“My job went to SaaS!
![Page 46: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/46.jpg)
Have good answers to these questions.
(Try to rationalize the discussion)
![Page 47: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/47.jpg)
Disadvantages?What‘s missing?
![Page 48: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/48.jpg)
Disadvantages? What‘s missing?
Amazon
Automated creation of multiple accounts with separate billing
API for Billing
Scalarium
Access Rights
Security Groups
MFA Support
![Page 49: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/49.jpg)
Have a scalable multitenancy architecture
Automatize everything
Don‘t forget The Human Factor
Conclusion
![Page 50: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/50.jpg)
![Page 51: Lessons Learned from Converting a Web Application to Multitenancy and Deploying it to Amazon Web Services using Scalarium](https://reader035.fdocuments.us/reader035/viewer/2022081413/5488f376b47959d30c8b583d/html5/thumbnails/51.jpg)
Infopark AG • Kitzingstraße 15 • D-12277 Berlin • www.infopark.de • [email protected]
[email protected]+49-151-140690-23
Twitter: @thomas_witt
Thomas Witt
That's a wrap!
Thank you!
Director Product & Business Development
Twitter: @infoparkfacebook.com/infopark