O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Java scalability considerations yogesh deshpande

2.058 visualizações

Publicada em

Session presented at the 6th IndicThreads.com Conference on Java held in Pune, India on 2-3 Dec. 2011.


Publicada em: Tecnologia
  • Seja o primeiro a comentar

  • Seja a primeira pessoa a gostar disto

Java scalability considerations yogesh deshpande

  1. 1. Scalability Considerations Yogesh Deshpande GS Lab 1
  2. 2. Agenda• Scalability • Overview • Relevance Of Java Platform • Vertical Scaling • Horizontal Scaling • Cloud ==Scalability ? true: false• Horizontal Scaling: Case Study • Problem Statement • Basic Principles • Architecture Highlights• References 2
  3. 3. Scalability: Overview• Allowing more users/mediums to use your application with consistent performance• System should be capable of handling increasing load dynamically• May come with cost of additional processing overhead• Its more about architecture and not about the language/frameworks 3
  4. 4. Relevance Of Java Platform• Components/libraries/tools are widely available with choice• Famous GC pause?• Specification like OSGI• Vertical scaling of JVM• Cloud Platforms• New languages like Scala, Clojure on JVM 4
  5. 5. Vertical Scaling• Adding resource within the same logical unit to increase capacity – Add CPU/Storage/memory• Some Solutions – AzulSystem’s Zinc: JVM with huge heap size – Terracotta’s BigMemory: JVM-level clustering 5
  6. 6. Horizontal Scaling• Adding multiple logical units of resources and making them work as a single unit – Think everything in terms of services – Most clustering solutions, distributed file systems, load-balancers help you with horizontal scalability – More processing overhead 6
  7. 7. Cloud == Scalability ? true:false• Not 100% true or false• I-a-a-S: If system is not scaling on data center it will not scale on Cloud• P-a-a-S: Has some meat – Google App Engine – Amazon Elastic Beanstalk – Oracle cloud and many more 7
  8. 8. Horizontal Scaling: Case Study• This particular product required to support one million users and processing packets coming from each user’s device at frequent time interval• Our aim was to build horizontal scalable system using java/j2ee technologies 8
  9. 9. Horizontal Scaling: Principles• Statelessness: – Each service should be stateless• Caching: – Use as much as you can• Parallelizing: – Distribute workload• Sharding: – Divide and Rule 9
  10. 10. Architecture Diagram of Case Study 10
  11. 11. Magnified View of Data Layer 11
  12. 12. Architecture Highlights of Case Study• RESTful Design: CRUD operations as Web service calls – Technology: Restlet.(Spring3.0 has it now)• Stateless UI: No Session on Server – Technology: Struts2.0• READ and WRITE layer: HTTP POST/PUT to WRITE and GET to READ – Technology: Hibernate for WRITE and Spring-jdbc for read. 12
  13. 13. Architecture Highlights• MySQL: Master/Slave replication• Workload Distribution:Scheduled job to run at multiple nodes – Simple logic to divide for (Long userId : allUserIds) { if ((userId % noOfNodes) == nodeId) { processUserData(userId); } } – Technology: Quartz library 13
  14. 14. Failover ConsiderationWhat can fail• Application Server• Database Server• Scheduled Jobs 14
  15. 15. References- Various articles on - http://highscalability.com - http://www.oracle.com - http://www.ibm.com 15
  16. 16. Thanks For further questions contact yogesh@gslab.com 16