8. SaaS ERP Multi-Tenancy @ Spain targeting non-technological SMB (PyMEs)? NO way! Cultural issues were (and are) impacting their bottom-line and single-tenancy at database allows them to send backups of data to their customers as a «peace of mind» They faced a trade-off between less scalability and bigger infrastructure costs, and selling to THEIR customers and easier development
9. SaaS ERP 1st boxed software, on premises deploy & customization, remote upgrades, support, etc.. 2nd Dual offering, boxed to big/special customers and SaaS using the same code base to smaller customers -> saving on support and upgrades 3rd Re-engineering of code to allow better concurrency. Developing their own RDP load balancer and a runtime to improve developing software (Visual Basic to C#.Net)
10. SaaS ERP: Re-engineering Problems: Low concurrency level One user could affect all user on this server Peaks at month end (billing, payroll,…) Printing Licenses cost (Citrix, Terminal Server, Windows, SQL Server)
11. SaaS ERP: Re-engineering Solutions: 3 tier model (client, application server, database) Client only renders, all calculations at server side Same client and application server for all customers Most reports go to printer so speed isn’t important, let’s shape the demand Leverage asynchronous calls between client and server Found tool to get rid of those printer drivers at the Terminal server Developed a tool with instrumentation to substitute Citrix licenses Has to be single-tenant at database side
13. 6.1. SaaS 34330 EEDC Execution Environments for Distributed Computing 6.1.1. What’s SaaS 6.1.2. Multi-Tenancy? 6.1.3. Batch processing Master in Computer Architecture, Networks and Systems - CANS
14. Batch processing only for Research? What’s Batch processing? Wait to have a bunch of things to process Launch process to do things that last some time Get the results after non trivial time Why Batch processing? Better Throughput at Latency expenses
15. Batch processing only for Research? What’s Batch processing? Wait to have a bunch of things to process Launch process to do things that last some time Get the results after non trivial time Why Batch processing? Better Throughput at Latency expenses
18. Batch optimization If we wait enough… We’ll have enough e-mails to same server to leverage SMTP Pipelining TCP Slow Start. Typical email 30 KB, BW 100 mb/s = 2 ms/email, but RTT 200 ms
19. Batch optimization If we wait enough… We’ll have other problems File System, too many files at the same folder Time to read/create file O(n) on most file systems Spool has to be persistent so we have to much write IOPS Leverage hashing again Hash files to folders so: 12132324.queue -> ab/c3/12132324.queue Enable write back cache at the storage device
20. Batch optimization If we wait enough… Went from 5.000 emails/hour to 500.000 emails/hour And save money as senders only need to be up when they are doing something (API to IaaS provider)
21. Reporting optimization Every click or image went to an Apache Server Look for URL to redirect Insert to access MySQL Reporting using real-time aggregation queries
22. Reporting optimization Using a CDN + log parsing + Hive + Hbase we can escalate reporting As the CDN doesn’t cache HTTP redirects we enable a poll based server sending redirects and logging the access Urls looks like: http://esp.net/customer_id/link_id/mail_id Also is easy to escalate with a simple load balancer
23. Aboutthissession 34330 Execution Environments for Distributed Computing (EEDC), Master in Computer Architecture, Networks and Systems (CANS) Computer Architectura Department (AC) UniversitatPolitècnica de Catalunya – Barcelona Tech (UPC) INSTRUCTOR Sergi Morales, Founder & CTO of Expertos en TIPhone: +34 6688-XPNTIEmail : sergi.morales+eedc@expertosenti.comBlog : http://blog.expertosenti.com Web: http://www.expertosenti.com
24. About the EEDC course 34330 Execution Environments for Distributed Computing (EEDC), Master in Computer Architecture, Networks and Systems (CANS) Computer Architectura Department (AC) Universitat Politècnica de Catalunya – Barcelona Tech (UPC) ECTS credits: 6 INSTRUCTOR Professor Jordi TorresPhone: +34 93 401 7223 Email : torres@ac.upc.eduOffice : Campus Nord, Modul C6. Room 217. Web: http://www.JordiTorres.org
25. 34330 EEDC Execution Environments for Distributed Computing Sergi Morales Founder & CTO T: 668897684 E: sergi.morales@expertosenti.com L: www.linkedin.com/in/sergimorales Master in Computer Architecture, Networks and Systems - CANS
26. Case Asynchronous access to Facebook API server Expect to fail Tables with so many rows, a key/value approach Consistent hashing to loadbalance data Sticky servers?