Designing for Scalability. Patrick Linskey EJB Team Lead BEA Systems

Similar documents
Craig Blitz Oracle Coherence Product Management

Executive Summary. It is important for a Java Programmer to understand the power and limitations of concurrent programming in Java using threads.

Pimp My Data Grid. Brian Oliver Senior Principal Solutions Architect <Insert Picture Here>

Massive Scalability With InterSystems IRIS Data Platform

A developer s guide to load testing

Low Latency Data Grids in Finance

Using the SDACK Architecture to Build a Big Data Product. Yu-hsin Yeh (Evans Ye) Apache Big Data NA 2016 Vancouver

ORACLE IDENTITY MANAGER SIZING GUIDE. An Oracle White Paper March 2007

White Paper. Major Performance Tuning Considerations for Weblogic Server

ebay Marketplace Architecture

PayPal Delivers World Class Customer Service, Worldwide

Best Practices for Scaling Websites Lessons from ebay

Architekturen für die Cloud

Boost Your Hibernate and Application Performance

ebay s Architectural Principles

Reactive Systems. Dave Farley.


CISC 7610 Lecture 2b The beginnings of NoSQL

How (Not) to Build Scalable Applications in ONOS. Jordan Halterman Member of Technical ONF

SCYLLA: NoSQL at Ludicrous Speed. 主讲人 :ScyllaDB 软件工程师贺俊

Huge market -- essentially all high performance databases work this way

Spark Overview. Professor Sasu Tarkoma.

PERFORMANCE INVESTIGATION TOOLS & TECHNIQUES. 7C Matthew Morris Desynit

Processing of big data with Apache Spark

OS and HW Tuning Considerations!

MySQL Database Scalability

Building a Scalable Architecture for Web Apps - Part I (Lessons Directi)

HYBRID TRANSACTION/ANALYTICAL PROCESSING COLIN MACNAUGHTON

Hibernate Search Googling your persistence domain model. Emmanuel Bernard Doer JBoss, a division of Red Hat

BUILDING A SCALABLE MOBILE GAME BACKEND IN ELIXIR. Petri Kero CTO / Ministry of Games

Embedded Technosolutions

Lecture 9: MIMD Architectures

Bipul Sinha, Amit Ganesh, Lilian Hobbs, Oracle Corp. Dingbo Zhou, Basavaraj Hubli, Manohar Malayanur, Fannie Mae

Traditional RDBMS Wisdom is All Wrong -- In Three Acts. Michael Stonebraker

WebLogic Server- Tips & Tricks for Troubleshooting Performance Issues. By: Abhay Kumar AST Corporation

Oracle Database 12c: JMS Sharded Queues

Backtesting with Spark

Jargons, Concepts, Scope and Systems. Key Value Stores, Document Stores, Extensible Record Stores. Overview of different scalable relational systems

Oracle WebLogic Server Multitenant:

Transactum Business Process Manager with High-Performance Elastic Scaling. November 2011 Ivan Klianev

Achieving Horizontal Scalability. Alain Houf Sales Engineer

Design Patterns for Large- Scale Data Management. Robert Hodges OSCON 2013

Scaling Out Tier Based Applications

OS and Hardware Tuning

Hi! NET Developer Group Braunschweig!

Pragmatic Clustering. Mike Cannon-Brookes CEO, Atlassian Software Systems

RA-GRS, 130 replication support, ZRS, 130

Lightstreamer. The Streaming-Ajax Revolution. Product Insight

Performance Matters Scaling Integration Processes to Meet the Needs of Your Business. James Ahlborn, Chief Software Architect, Dell Boomi

Monday, November 21, 2011

Distributed Programming

MySQL Architecture Design Patterns for Performance, Scalability, and Availability

Oracle 10g and IPv6 IPv6 Summit 11 December 2003

XTP, Scalability and Data Grids An Introduction to Coherence

Outline. Definition of a Distributed System Goals of a Distributed System Types of Distributed Systems

DISTRIBUTED SYSTEMS [COMP9243] Lecture 8a: Cloud Computing WHAT IS CLOUD COMPUTING? 2. Slide 3. Slide 1. Why is it called Cloud?

Creating Ultra-fast Realtime Apps and Microservices with Java. Markus Kett, CEO Jetstream Technologies

Wasser drauf, umrühren, fertig?

Chapter Outline. Chapter 2 Distributed Information Systems Architecture. Layers of an information system. Design strategies.

MATLAB as a Financial Engineering Development Platform Delivering Financial / Quantitative Models to the Enterprise Eugene McGoldrick

<Insert Picture Here> Getting Coherence: Introduction to Data Grids Jfokus Conference, 28 January 2009

Inside GigaSpaces XAP Technical Overview and Value Proposition

Java EE 7 Recipes for Concurrency. Presented By: Josh Juneau Author and Application Developer

Scaling up MATLAB Analytics Marta Wilczkowiak, PhD Senior Applications Engineer MathWorks

J2EE DIAGNOSING J2EE PERFORMANCE PROBLEMS THROUGHOUT THE APPLICATION LIFECYCLE

GIS - Clustering Architectures. Raj Kumar Integration Management 9/25/2008

Big data systems 12/8/17

Armon HASHICORP

Easy Scalability with Akka. Distribute your domain

Architecting Java solutions for CICS

Conceptual Modeling on Tencent s Distributed Database Systems. Pan Anqun, Wang Xiaoyu, Li Haixiang Tencent Inc.

Performance and Optimization Issues in Multicore Computing

Oracle Database 10G. Lindsey M. Pickle, Jr. Senior Solution Specialist Database Technologies Oracle Corporation

WHEN CONTAINERS AND VIRTUALIZATION DO - AND DON T - WORK TOGETHER

WLS Neue Optionen braucht das Land

Everything You Need to Know About MySQL Group Replication

Memory Management for Spark. Ken Salem Cheriton School of Computer Science University of Waterloo

Diagnostics in Testing and Performance Engineering

Introduction to MySQL InnoDB Cluster

New Features in EJB 3.1

Tuesday, June 22, JBoss Users & Developers Conference. Boston:2010

The Oracle Database Appliance I/O and Performance Architecture

ARCHITECTING WEB APPLICATIONS FOR THE CLOUD: DESIGN PRINCIPLES AND PRACTICAL GUIDANCE FOR AWS

Exam Questions

WHEN CONTAINERS AND VIRTUALIZATION DO AND DON T - WORK TOGETHER JEREMY EDER

Improving Data Access of J2EE Applications by Exploiting Asynchronous Messaging and Caching Services

Java EE 7: Back-End Server Application Development

Fast Track to Java EE

extreme Scale caching alternatives for Bank ATM Offerings

COMP6511A: Large-Scale Distributed Systems. Windows Azure. Lin Gu. Hong Kong University of Science and Technology Spring, 2014

SPEC Enterprise Java Benchmarks State of the Art and Future Directions

Modern Stream Processing with Apache Flink

About Terracotta Ehcache. Version 10.1

Database Architectures

@joerg_schad Nightmares of a Container Orchestration System

Distributed KIDS Labs 1

ECE 587 Hardware/Software Co-Design Lecture 07 Concurrency in Practice Shared Memory I

Concurrency: State Models & Design Patterns

Achieving Scalability and High Availability for clustered Web Services using Apache Synapse. Ruwan Linton WSO2 Inc.

Topics. Big Data Analytics What is and Why Hadoop? Comparison to other technologies Hadoop architecture Hadoop ecosystem Hadoop usage examples

Transcription:

Designing for Scalability Patrick Linskey EJB Team Lead BEA Systems plinskey@bea.com 1

Patrick Linskey EJB Team Lead at BEA OpenJPA Committer JPA 1, 2 EG Member 2

Agenda Define and discuss scalability Vertical Horizontal Examine ways to make software scale Code / Algorithms Asynchronous Libraries Other Languages 3

Scalability Ability to increase the total number of operations performed in a unit of time Vertical Scalability: Make the machine bigger Horizontal Scalability Add more machines 4

Bottlenecks Limit the scalability of a system Intrinsic bottlenecks Artificial bottlenecks 5

Example Problem Domain Financial fund management Multiple in-house engineering needs Trade Execution Trade Settlement Strategy Definition Strategy Simulation Portfolio Risk Analysis 6

Vertical Scalability Translated into Java: Scaling Within a Machine 7

Vertical Scale Factors In Your Control Improve code efficiency Memory CPU Optimize I/O between physical tiers Web 2.0: beware! Make code scale across multiple cores / CPUs 8

Code Optimization Possibilities Performance and scalability are linked Scalability: more operations per time unit time time Architectural time Quick and dirty 9

Scale Vertically via Code Optimization Reduce copying, looping, etc. Write good code SQL statement batching PreparedStatement.addBatch() ORM frameworks Transaction batching Especially powerful in XA environments JMS message batching 10

Write-Once Shared Memory class SlowTradeManager { private Set types; public synchronized Set gettradetypes() { if (types == null) types = loadtypedata(); return types; } } class FastTradeManager { private Set types; public Set gettradetypes() { if (types == null) types = loadtypedata(); return types; } } loadtypedata() might be called more than once 11

Fund Risk Balancing Problem Multiple traders act on the same security Solution Maintain fund-global position data Mutable shared state! 12

Multi-machine solution (circa 1998) time 13

Synchronization synchronized is for asynchronous execution Execute this block of code in its entirety before others that share this lock Modern computers handle high* concurrency synchronized is often a bottleneck Avoid synchronization at runtime at all costs uncontended synchronization is cheap 14

Multi-core / CPU synchronization sync sync sync sync sync time 15

Mutable Shared Memory import java.util.concurrent.atomic.atomicdouble; class AggregateFundPosition { private AtomicDouble totalexposure = new AtomicDouble(0); public double incrementby(double amount) { while (true) { double old = totalexposure.get(); double next = old + amount; if (counter.compareandset(old, next)) return next; } } } 16

Synchronization-free shared state CAS CAS CAS CAS CAS CAS time 17

Horizontal Scalability Translated into Java: Scaling Across Machines 18

Horizontal Scaling: Add More Servers All doing the same thing Partitioned by infrastructure layer Partitioned by application role Partitioned along data graph boundaries 19

Build a Farm App App App Load Balancer App App App App 20

Slow Down App Web EJB 237ms 983ms 21

Divide and Conquer Old as `time` itself mail, news, telnet all on different servers You use partitioning every day Telephone call routing ATM card transactions Stock markets Elevator banks 22

Break Up Stateful Services Worldwide Trade Execution, Clearing, Position Analysis Apps Apps Apps Apps 23

Partition Along Application Boundaries Trade Clearing Trade Execution Position Analysis Apps Apps Apps Apps Apps Apps 24

Partition along data set fault lines US Europe Asia Apps Apps Apps Apps Apps Apps 25

Asynchrony in Java Java is a mostly synchronous environment Business algorithms often aren t Take advantage of this where possible JMS message queues java.util.concurrent.executorservice commonj.work.workmanager Scheduled jobs 26

Async Tasks and Resource Utilization Good JMS servers / ExecutorServices / WorkManagers do resource tuning and optimization Limit threads allocated to async processing Configure priority of async vs. sync (i.e., HTTP request) async tasks throttled async task backlog handled 100 Trade Settlement Strategy Analysis Trade Execution and Strategy Definition 75 50 25 0 27

Adapt Requirements to Concurrency Identify slow-running / expensive parts of the user experience Work with requirements team to replace these with asynchronous processes Website usage statistics generated nightly instead of on-demand Dynamic PDF delivery via email instead of embedded web content 28

Starting from Scratch 29

Choose Your Toolset Java makes synchronization easy... but synchronization!= scalability Other languages avoid shared state Rely on message-passing instead 30

Erlang: Functional, Asynchronous, Mature Designed for concurrency in the language Parallel execution Intrinsic hot-redeploy State can only be assigned once Communication happens via message-passing between actors No threads no shared state! JMS-like behavior; language-native syntax 31

Scala: Functional Programming for the JVM Java-integrated Designed by Java stalwart Martin Odersky JVM-optimized Supports Erlang-style concurrency 32

Compute Grids Federate your data around a cluster Decompose your algorithm into serializable work items Let the compute grid send your work items to the data 33

Decision Factors What are your application requirements? How many concurrent operations? How big of a workload? What sorts of SLAs? Tolerance of deployment complexity? How about your operations, QA teams? 34

Recap Concepts Scalability Bottlenecks Synchronization Asynchrony vs. concurrency Compare-and-set Application Partitioning Synchronous tasks vs. asynchronous tasks Technology java.util.concurrent j.u.concurrent.atomic Operation batching Transactions SQL JMS; Executor; WorkManager Scala and Erlang Hibernate Shards OpenJPA Slice 35

Questions Patrick Linskey plinskey@bea.com 36