Building Scalable Solutions for Commerce August 2011 Kalaiselvan Head, Product Engineering  Cloud Computing & Enterprise A...
Disclaimer <ul><li>Coverage Disclaimer </li></ul><ul><ul><li>Only key scalability aspect of building large scale applicati...
Largest e-Commerce Sites – Quick View
Scalability Need in Commerce <ul><li>80% of the traffic can be serviced by servers handling static content (browsing, user...
Our experience in building scalable solutions <ul><li>Our customer is a small start-up dedicated to helping homeowners, lo...
Scalability that we evolved with.. <ul><li>Our approach were </li></ul><ul><ul><li>We placed all of the application compon...
Customer reached us again for scalability.. <ul><ul><li>Increasing the hardware resources without changing the number of n...
Scalability demand increases.. <ul><li>Our suggestion </li></ul><ul><ul><li>To separate the database and place it under in...
Scalability in dire need.. <ul><li>Our recommendation </li></ul><ul><ul><li>We increase the capacity by adding additional ...
So our customer system looked like…
Scalability design challenges  <ul><li>Cost </li></ul><ul><ul><li>How much one could afford to spend on h/w for the increa...
Scalability Design Requirements <ul><li>Increase in performances </li></ul><ul><ul><li>Caching, Replication techniques </l...
Scalability of architecture layers <ul><li>Client </li></ul><ul><ul><li>HTTP Protocol </li></ul></ul><ul><ul><li>jCache – ...
Memcached Caching <ul><li>An open-source, distributed memory caching system </li></ul><ul><li>Has two components client an...
NoSQL <ul><li>No schema required </li></ul><ul><ul><li>Data can be inserted in a NoSQL database without first defining a r...
Today, our customer web site closely looks to be.. Technology Used Java, EJB, Servlet, Jboss, EHCache, Restful webservices...
Multiple scalability design approaches <ul><li>Load balancing </li></ul><ul><ul><li>Vertical scaling and Horizontal Scalin...
Tips for Scalability Design Approach <ul><li>Scale with hardware vertical / horizontal as needed </li></ul><ul><li>Caching...
Tips for Scalability Design Approach <ul><li>Don't try Over Design upfront only </li></ul><ul><li>Scaling takes Iteration(...
<ul><li>Application Software ,  Smart Energy  Banking-Financial- Services-Insurance  BFSI ,  Business  Intelligence ,  Bus...
Appendix <ul><li>Additional back-up slides further down available on demand </li></ul>
HTTP in Scalability Design <ul><li>Design Considerations </li></ul><ul><ul><li>Architect your application in a way that en...
Caching / Replication <ul><li>Readily accessible data structure that allows thread-safe access to in-memory data </li></ul...
Asynchronous Messaging <ul><li>Asynchronous process will not block further processing and may optionally be notified when ...
Request Processing <ul><li>Connection Management </li></ul><ul><li>Data Marshaling </li></ul><ul><li>Request Servicing </l...
Parallelism <ul><li>Conceptually doing more then one task at a time. Based on hardware and software it can be implemented ...
Redundancy <ul><li>Duplication of hardware or software, so that more resource are available for execution  </li></ul><ul><...
Upcoming SlideShare
Loading in …5
×

Silicon India Java Conference: Building Scalable Solutions For Commerce Silicon India Aug2011 V6 Mindteck

4,226 views

Published on

Spoke at SiliconIndia Java Conference in Aug2011

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
4,226
On SlideShare
0
From Embeds
0
Number of Embeds
60
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Silicon India Java Conference: Building Scalable Solutions For Commerce Silicon India Aug2011 V6 Mindteck

  1. 1. Building Scalable Solutions for Commerce August 2011 Kalaiselvan Head, Product Engineering Cloud Computing & Enterprise Architecture http://www.mindteck.com/coe/cloud-computing.html Version1.6
  2. 2. Disclaimer <ul><li>Coverage Disclaimer </li></ul><ul><ul><li>Only key scalability aspect of building large scale applications, </li></ul></ul><ul><ul><li>but I’m sincerely working on expanding it! </li></ul></ul><ul><li>Presentation </li></ul><ul><ul><li>I’m only representing what I’ve understood, learnt and practiced during my architecture experience </li></ul></ul><ul><li>Objective </li></ul><ul><ul><li>I’m here to share and learn and I’m sure you gathered here for the same purpose too! </li></ul></ul><ul><ul><li>Good luck to you all  </li></ul></ul>
  3. 3. Largest e-Commerce Sites – Quick View
  4. 4. Scalability Need in Commerce <ul><li>80% of the traffic can be serviced by servers handling static content (browsing, user registration, and search operations) </li></ul><ul><li>Only 20% of the traffic can be serviced by servers handling heavy-duty operations (add items and buy) </li></ul><ul><ul><ul><li>For example, in a population of 100,000 users, there are approximately 10,000 users adding items to their shopping basket or buying, while 90,000 users browse, search, or register </li></ul></ul></ul>http://technet.microsoft.com/en-us/library/bb687366.aspx Browse 80% Search 9% User Registration 2% Add item 5% Buy 4%
  5. 5. Our experience in building scalable solutions <ul><li>Our customer is a small start-up dedicated to helping homeowners, local authorities and businesses achieve carbon reduction and energy efficiency measures in UK </li></ul><ul><li>They have had a plan to build monitoring and control systems that can grow up to 750k customer base in UK </li></ul><ul><li>Need an foundational IT solution for today and that can possibly grow with the customer base over a period of time </li></ul>IT System
  6. 6. Scalability that we evolved with.. <ul><li>Our approach were </li></ul><ul><ul><li>We placed all of the application component installed in a single server including web server, app server and database server </li></ul></ul><ul><li>Our rationale </li></ul><ul><ul><li>Customer is cost conscious and insisted us that their high end server could take care of all the scalability need </li></ul></ul>Technology Java, Jboss, Hibernate, Restful Web services with MySQL
  7. 7. Customer reached us again for scalability.. <ul><ul><li>Increasing the hardware resources without changing the number of nodes </li></ul></ul><ul><ul><li>Referred to as “Scaling up” the Server </li></ul></ul><ul><li>Our suggestion were </li></ul><ul><ul><li>We Increased the capacity by upgrading hardware specifications, while maintaining the physical footprint and number of servers in the server farm </li></ul></ul><ul><li>Our rationale </li></ul><ul><ul><li>Scaling hardware vertically simplifies site management, limited cost addition, and time to implement the solution </li></ul></ul>
  8. 8. Scalability demand increases.. <ul><li>Our suggestion </li></ul><ul><ul><li>To separate the database and place it under individual physical node </li></ul></ul>Technology: Java, EJB, Servlet with simple JCA with JCACHE implementation <ul><ul><li>Each service deployed at individual physical node/hardware </li></ul></ul>
  9. 9. Scalability in dire need.. <ul><li>Our recommendation </li></ul><ul><ul><li>We increase the capacity by adding additional servers </li></ul></ul><ul><li>Our rationale </li></ul><ul><ul><li>Scaling hardware horizontally enables you to increase hardware capacity </li></ul></ul><ul><ul><li>Served to meet the application SLA (Performance, Scalability etc) </li></ul></ul>Load Balancer
  10. 10. So our customer system looked like…
  11. 11. Scalability design challenges <ul><li>Cost </li></ul><ul><ul><li>How much one could afford to spend on h/w for the increasing scalability </li></ul></ul><ul><li>Timeline </li></ul><ul><ul><li>Sooner, you do it better the business returns </li></ul></ul><ul><li>Maintainability & Manageability </li></ul><ul><ul><li>Easy to maintain as the complexity of the components grows </li></ul></ul><ul><li>Tools and Technology Approach </li></ul><ul><ul><li>Choice of tool that could directly provide scalability features for easy leverage </li></ul></ul><ul><li>(Growing) Data </li></ul><ul><ul><li>Complex business process in dealing with the data </li></ul></ul><ul><ul><li>information access is become more challenge with additional layer of complexity with scalable components </li></ul></ul>
  12. 12. Scalability Design Requirements <ul><li>Increase in performances </li></ul><ul><ul><li>Caching, Replication techniques </li></ul></ul><ul><li>Low Latency </li></ul><ul><ul><li>Network dependency, too many back-end integrations, multiple dB read/write access </li></ul></ul><ul><li>High Reliability </li></ul><ul><ul><li>Data integrity and access to right info </li></ul></ul><ul><li>Dynamic – No of users, volume of data </li></ul><ul><ul><li>Data peak load during the spike </li></ul></ul><ul><li>Operational efficiency </li></ul><ul><ul><li>Round-trip presentation, retrieval and performance </li></ul></ul><ul><li>Low cost </li></ul><ul><ul><li>Focus on design, than investing on new features </li></ul></ul><ul><li>High Availability </li></ul><ul><ul><li>To make always the features are available </li></ul></ul><ul><li>Manageability </li></ul><ul><ul><li>Its easy to manage and administer with limited skill and knowledge </li></ul></ul>
  13. 13. Scalability of architecture layers <ul><li>Client </li></ul><ul><ul><li>HTTP Protocol </li></ul></ul><ul><ul><li>jCache – jQuery plugin </li></ul></ul><ul><li>Application Server </li></ul><ul><ul><li>Java Caching System / JCACHE (http://commons.apache.org/jcs/) </li></ul></ul><ul><ul><li>Jboss Cache </li></ul></ul><ul><ul><ul><li>It cached all of frequently accessed Java objects </li></ul></ul></ul><ul><ul><ul><li>Utilized its fully transactional features for concurrent data access </li></ul></ul></ul><ul><ul><ul><li>Implemented clustered cache </li></ul></ul></ul><ul><ul><li>Distributed Server Caching (EHCache) </li></ul></ul><ul><ul><li>Resource / Connection Pooling (Thread Pool, EJB Pool) </li></ul></ul><ul><ul><li>Synch Vs Asynch Choice of Messaging (Restful Webservices) </li></ul></ul><ul><li>Database </li></ul><ul><ul><li>Data Replication </li></ul></ul><ul><ul><li>Database Sharding or Partitioning </li></ul></ul><ul><ul><li>Sharding helps to isolate and constrain storage, CPU, memory, and IO </li></ul></ul><ul><ul><li>NoSQL </li></ul></ul><ul><ul><li>Memchaced ( in progress) </li></ul></ul>
  14. 14. Memcached Caching <ul><li>An open-source, distributed memory caching system </li></ul><ul><li>Has two components client and server </li></ul><ul><li>Memcached leverages a two-stage hash that acts as like a giant hash table looking up key = value pairs </li></ul><ul><ul><li>While look up, the client hashes the key against a list of servers and the server performs hashkey lookup for actual data </li></ul></ul><ul><ul><li>Because the client performs one stage of the hashing, Memcached naturally lends itself towards the ability to easily add dozens of additional nodes </li></ul></ul><ul><li>Java Client Libraries </li></ul><ul><ul><li>Memcached Client for Java (http://www.whalin.com/memcached/) </li></ul></ul><ul><ul><li>Spymemcached – Java Client for Memcached (http://code.google.com/p/spymemcached/) </li></ul></ul>Web Server Memcached Relational Database
  15. 15. NoSQL <ul><li>No schema required </li></ul><ul><ul><li>Data can be inserted in a NoSQL database without first defining a rigid database schema </li></ul></ul><ul><ul><li>the format of the data being inserted can be changed at any time, without application disruption </li></ul></ul><ul><li>Auto-sharding (i.,e elasticity) </li></ul><ul><ul><li>A NoSQL database automatically spreads data across servers </li></ul></ul><ul><ul><li>Also support data replication, storing multiple copies of data across the cluster </li></ul></ul><ul><li>Distributed query support </li></ul><ul><li>Integrated caching </li></ul><ul><li>Product Implementation </li></ul><ul><ul><li>BigTable (Google) </li></ul></ul><ul><ul><li>Dynamo (Amazon) </li></ul></ul>
  16. 16. Today, our customer web site closely looks to be.. Technology Used Java, EJB, Servlet, Jboss, EHCache, Restful webservices, MySQL DB DB Distributed caching is used
  17. 17. Multiple scalability design approaches <ul><li>Load balancing </li></ul><ul><ul><li>Vertical scaling and Horizontal Scaling </li></ul></ul><ul><li>Caching/replication </li></ul><ul><ul><li>Distributed Caching </li></ul></ul><ul><li>Partitioning </li></ul><ul><ul><li>Horizontal Partitioning and Vertical Partitioning </li></ul></ul><ul><ul><li>Sharding / NoSQL </li></ul></ul><ul><li>Parallelism </li></ul><ul><ul><li>Concurrency </li></ul></ul><ul><li>Redundancy </li></ul><ul><ul><li>Replication </li></ul></ul><ul><li>Request Processing </li></ul><ul><li>Asynchronous Messaging </li></ul><ul><li>Multi-thread </li></ul><ul><li>Resource Pooling </li></ul><ul><ul><li>EJB Pools, Thread Pools, DB Connection Pool </li></ul></ul><ul><li>Session Management </li></ul><ul><ul><li>Http Session </li></ul></ul>
  18. 18. Tips for Scalability Design Approach <ul><li>Scale with hardware vertical / horizontal as needed </li></ul><ul><li>Caching is the key, start with it first always </li></ul><ul><li>Use Caching Extensively and Appropriately </li></ul><ul><ul><li>Do cache all of your site static content  </li></ul></ul><ul><ul><li>Do cache static look-up data </li></ul></ul><ul><ul><li>Use connection pooling and resource management techniques </li></ul></ul><ul><li>Consolidate business logic on dedicated servers  </li></ul><ul><ul><li>Eliminate business logic layer state when possible </li></ul></ul><ul><li>Consider logical versus physical tiers </li></ul><ul><li>Isolate transactional methods </li></ul><ul><li>Constraint concurrent access to limited resource </li></ul><ul><li>Usage of java.util.concurrent package </li></ul>
  19. 19. Tips for Scalability Design Approach <ul><li>Don't try Over Design upfront only </li></ul><ul><li>Scaling takes Iteration(s) and design reviews </li></ul><ul><li>Right tool and technology support is critical for your design </li></ul><ul><li>Review Scalability Need time to time </li></ul>
  20. 20. <ul><li>Application Software , Smart Energy Banking-Financial- Services-Insurance BFSI , Business Intelligence , Business Process Outsourcing , Content Analytics , Electronic Design Services , Firmware , Hardware / Device , Infrastructure , Java , Knowledge Management , Wireless </li></ul><ul><li>Life Sciences , Maintenance , Mechanical , Microsoft Technologies , Mobile Platforms , MySQL , Open Source , Oracle , Public Sector , Product Development , QA & Testing Services , SAP , Services , Semiconductor , Smart Energy , Storage , Support Services , System Software , SQL Server , Verticals , ZigBee </li></ul>Thank You
  21. 21. Appendix <ul><li>Additional back-up slides further down available on demand </li></ul>
  22. 22. HTTP in Scalability Design <ul><li>Design Considerations </li></ul><ul><ul><li>Architect your application in a way that encourages HTTP caching </li></ul></ul><ul><ul><li>Know settings of an HTTP server that affect scalability and performance </li></ul></ul><ul><ul><li>Understand important efficiency-related parameters of a typical HTTP API provided by Java </li></ul></ul><ul><li>Scalability Tips </li></ul><ul><ul><li>Use GET and POST Judiciously </li></ul></ul><ul><ul><li>Consider HTTP for Nonbrowser Clients </li></ul></ul><ul><ul><li>Promote HTTP Response Caching </li></ul></ul><ul><ul><li>Support Persistent Connections </li></ul></ul>
  23. 23. Caching / Replication <ul><li>Readily accessible data structure that allows thread-safe access to in-memory data </li></ul><ul><ul><li>Clustered Cache </li></ul></ul><ul><ul><ul><li>Cache system where each cache instance is aware of other cache instances in a cluster and is capable of synchronizing operations with its peers. Cache contents are typically mirrored </li></ul></ul></ul><ul><ul><li>Distributed Cache </li></ul></ul><ul><ul><ul><li>Distribute any cached state across a cluster to maximize retrieval efficiency, reduce overall memory used, and guarantee data redundancy (fragmented data sets over the network) </li></ul></ul></ul><ul><li>Technology Tool </li></ul><ul><ul><li>Squid, EHCache </li></ul></ul><ul><ul><li>Jcache (JSR107) </li></ul></ul><ul><ul><li>Memcached </li></ul></ul>
  24. 24. Asynchronous Messaging <ul><li>Asynchronous process will not block further processing and may optionally be notified when the operation is completed </li></ul><ul><li>Use Java 5.0 Concurrency package for asynchronous behavior </li></ul><ul><li>Ajax Asynchronous JavaScript and XML) </li></ul><ul><ul><li>XMLHttpRequest object is used to exchange data asynchronous from the web server </li></ul></ul><ul><li>JMS (Java Messaging Service) </li></ul><ul><ul><li>In distributed environment JMS API can be used to read, receive and send messages in multiple formats </li></ul></ul><ul><li>Asynchronous Web Services </li></ul><ul><li>Asynchronous communication mode: </li></ul><ul><ul><li>Polling type </li></ul></ul><ul><ul><li>Push type </li></ul></ul>
  25. 25. Request Processing <ul><li>Connection Management </li></ul><ul><li>Data Marshaling </li></ul><ul><li>Request Servicing </li></ul><ul><li>Design Considerations </li></ul><ul><ul><li>Synchronous Communication </li></ul></ul><ul><ul><ul><li>Servlets/JSP </li></ul></ul></ul><ul><ul><li>Asynchronous Communication </li></ul></ul><ul><ul><ul><li>JMS </li></ul></ul></ul>
  26. 26. Parallelism <ul><li>Conceptually doing more then one task at a time. Based on hardware and software it can be implemented </li></ul><ul><li>Software –Thread Based Applns </li></ul><ul><li>Hardware </li></ul><ul><ul><li>Massively parallel processors (MPP) – Nodes that don’t share data but compute by routing data between nodes. </li></ul></ul><ul><ul><li>Symmetric multiprocessing machines(SMP) –Nodes consists of multiple processors that share same data </li></ul></ul><ul><ul><li>Clustered computing system – Nodes consists of multiple computers that don’t share same data but route it between computers over network </li></ul></ul>
  27. 27. Redundancy <ul><li>Duplication of hardware or software, so that more resource are available for execution </li></ul><ul><li>Redundancy increases ability of system to scale but increases reliability </li></ul><ul><ul><li>Availability of application in case of one node crashes </li></ul></ul><ul><li>It refers duplication of data in all nodes </li></ul><ul><ul><li>Drawback are deployment cost and consistency </li></ul></ul>

×