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

Similar documents
HA solution with PXC-5.7 with ProxySQL. Ramesh Sivaraman Krunal Bauskar

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

Lesson 4 Transcript: DB2 Architecture

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

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

Architekturen für die Cloud

Boost Your Hibernate and Application Performance

Percona XtraDB Cluster ProxySQL. For your high availability and clustering needs

Coherence An Introduction. Shaun Smith Principal Product Manager

High Availability/ Clustering with Zend Platform

GlassFish High Availability Overview

Scalability of web applications

How To Make Databases on Linux on System z Highly Available

MySQL High Availability

SCALABLE DATABASES. Sergio Bossa. From Relational Databases To Polyglot Persistence.

MySQL HA Solutions. Keeping it simple, kinda! By: Chris Schneider MySQL Architect Ning.com

<Insert Picture Here> Oracle Application Cache Solution: Coherence

Designing for Scalability. Patrick Linskey EJB Team Lead BEA Systems

XTP, Scalability and Data Grids An Introduction to Coherence

Multiprocessor System. Multiprocessor Systems. Bus Based UMA. Types of Multiprocessors (MPs) Cache Consistency. Bus Based UMA. Chapter 8, 8.

Low Latency Data Grids in Finance

Alfresco 2.1. Backup and High Availability Guide

Multiprocessor Systems. COMP s1

Extreme Java Productivity with Spring Roo and Spring 3.0

CLIENT SERVER ARCHITECTURE:

Data Management in Application Servers. Dean Jacobs BEA Systems

<Insert Picture Here> Oracle Coherence & Extreme Transaction Processing (XTP)

PNUTS: Yahoo! s Hosted Data Serving Platform. Reading Review by: Alex Degtiar (adegtiar) /30/2013

Click to edit Master title style

Database Architectures

Solace JMS Broker Delivers Highest Throughput for Persistent and Non-Persistent Delivery

Performance, Scalability and High-availability of Enterprise Applications

Consistency and Scalability

Datacenter replication solution with quasardb

Connect with Remedy: SmartIT: Social Event Manager Webinar Q&A

<Insert Picture Here>

Multiprocessor Systems. Chapter 8, 8.1

Thursday, March 8, 12. Architecture at Scale

Microservices Beyond the Hype. SATURN San Diego May 3, 2016 Paulo Merson

Oracle WebLogic Server 12c: Administration I

Database code in PL-SQL PL-SQL was used for the database code. It is ready to use on any Oracle platform, running under Linux, Windows or Solaris.

<Insert Picture Here> MySQL Web Reference Architectures Building Massively Scalable Web Infrastructure

Real World Messaging With Apache ActiveMQ. Bruce Snyder 7 Nov 2008 New Orleans, Louisiana

MariaDB MaxScale 2.0, basis for a Two-speed IT architecture

ebay Marketplace Architecture

High Available Complex Event Processing with Red Hat JBoss BRMS. Duncan Doyle Senior Architect, Red Hat

High Available Complex Event Processing with Red Hat JBoss BRMS. Duncan Doyle Senior Architect, Red Hat

Qlik Sense Certification Exam Study Guide

TomcatCon London 2017 Clustering Mark Thomas

Enterprise print management in VMware Horizon

The new Ehcache and Hibernate Caching SPI Provider

Thinking Beyond Search with Solr Understanding How Solr Can Help Your Business Scale. Magento Expert Consulting Group Webinar July 31, 2013

CS 147: Computer Systems Performance Analysis

Rsyslog: going up from 40K messages per second to 250K. Rainer Gerhards

Oracle and Tangosol Acquisition Announcement

How To Make Databases on SUSE Linux Enterprise Server Highly Available Mike Friesenegger

HDFS Architecture. Gregory Kesden, CSE-291 (Storage Systems) Fall 2017

Postgres Plus and JBoss

WEBSPHERE APPLICATION SERVER

Scaling Your Cache & Caching at Scale. Alex

Building Microservices with the 12 Factor App Pattern

Massive Scalability With InterSystems IRIS Data Platform

ebay s Architectural Principles

Distributed CI: Scaling Jenkins on Mesos and Marathon. Roger Ignazio Puppet Labs, Inc. MesosCon 2015 Seattle, WA

Beyond 1001 Dedicated Data Service Instances

Lecture 23 Database System Architectures

10. Replication. CSEP 545 Transaction Processing Philip A. Bernstein. Copyright 2003 Philip A. Bernstein. Outline

Ossification of the Internet

Whitepaper. 4 Ways to Improve ASP.NET Performance. Under Peak Loads. Iqbal Khan. Copyright 2015 by Alachisoft

For those who might be worried about the down time during Lync Mobility deployment, No there is no down time required

USING ARTIFACTORY TO MANAGE BINARIES ACROSS MULTI-SITE TOPOLOGIES

Designing Data Protection Strategies for Lotus Domino

Chapter 20: Database System Architectures

Database Architectures

M I N S LITTLE BLACK BOOK OF JIRA SERVICE DESK ESSENTIALS

CISC 7610 Lecture 2b The beginnings of NoSQL

DITA PUBLISHING. The true costs of taking your DITA content online. A WebWorks.com White Paper.

App Servers NG: Characteristics of The Next Generation Application Servers. Guy Nirpaz, VP R&D and Chief Architect GigaSpaces Technologies

Transactions and ACID

Mysql Cluster Could Not Acquire Global Schema Lock

Polarion 18.2 Enterprise Setup

Scaling ColdFusion. Presenter Mike Collins, Sr. ColdFusion Consultant - SupportObjective

CS 514: Transport Protocols for Datacenters

KEYNOTE Dr. Michael Meskes, PhD CEO of credativ and Open Source Support Center Friday, October 11, 2013

GFS Overview. Design goals/priorities Design for big-data workloads Huge files, mostly appends, concurrency, huge bandwidth Design for failures

Cloud-Native Applications. Copyright 2017 Pivotal Software, Inc. All rights Reserved. Version 1.0

Maximize the Speed and Scalability of Your MuleSoft ESB with Solace

Distributed Data Infrastructures, Fall 2017, Chapter 2. Jussi Kangasharju

Persistent Storage with Docker in production - Which solution and why?

White Paper. Major Performance Tuning Considerations for Weblogic Server

Create High Performance, Massively Scalable Messaging Solutions with Apache ActiveBlaze

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

Take Your Oracle WebLogic Applications to The Next Level with Oracle Enterprise Manager 12c

EXPLORE MICROSOFT SHAREPOINT SERVER 2016 AND BEYOND #ILTAG70

Best Practices. Achieving high availability and scalability with IBM InfoSphere MDM Server. IBM InfoSphere Master Data Management Server

Broker Clusters. Cluster Models

Advanced HTTP session management with Oracle Coherence

Copyright 2016 Pivotal. All rights reserved. Cloud Native Design. Includes 12 Factor Apps

Track: EXTOL Business Integrator (EBI)

Rapid Large-Scale SOA - Connected Products at Leapfrog Enterprises

Transcription:

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

Confluence Largest enterprise wiki in the world 2000 customers in 60 countries J2EE application, ~500k LOC Hibernate, Lucene, Spring, WebWork Deployed by customers behind the firewall http://www.atlassian.com/confluence 2

Why Cluster? Horizontal scalability More machines = more scale Customer: our use of Confluence is increasing beyond a single machine. High availability More machines = more overall uptime Customer: our wiki cannot be down. 3

The Plan Start by asking a simple question: What breaks when 2 Confluence instances run against a single database? Breakages? For example dirty cache reads. 4

The Answer 5

The Answer Expected Caches 5

The Answer Expected Actual Caches Caches Lucene Indexes Events Configuration File Access Scheduled Jobs 5

Strategies Strategy Central Share Distributed Share Synchronize Temporize Example Database Clustered cache Lucene index per node Thumbnails With synchronised, need to handle desynchronisation case (ie new node coming up) 6 Clustered cache is distributed share, database is centralised share

First... Get used to trade offs! There is no perfect design. Pick the closest to you and handle the trade offs. 7

Our Design All nodes identical Sticky sessions No shared file system Low admin overhead Assume the database scales No master / slave, as this simplifies the topology. Confluence is an end user application, we can t assume the customer has a shared FS No session replication overhead is great, small downside of session loss. We ship this to end customers, so administration must be simple. Example here is the cluster name vs IP/port combination. Note, this design does not please _everyone_ - eg www.ibm.com remote clusters don t work. 8

Implementation Lessons Caches, Cluster Management, Lucene, Events, Files, Scheduled Jobs, Testing 9

Problem 1. Caches Cached data per node leads to dirty reads No caches = most scalable! Push all work into the database Not performant for most apps Otherwise, need a replicated cache 10

1. Caches Solution Strategy: distributed share Use a library Commercial: Tangosol Coherence, Gigaspaces, Terracotta, Gemstone Open Source: Ehcache, OSCache, JBoss Cache Confluence: Tangosol Coherence Make everything serializable Select partitioned vs replicated caches Amusing anecdote - first time we brought up a clustered cache, the entire development team became a cluster! 11

Problem Solution 2. Cluster Management Node discovery & heartbeat Cluster information Execute code across the cluster 1. Choose a good library 2. Implement it all yourself! Amusing anecdote - first time we brought up a clustered cache, the entire development team became a cluster! 12

2. Cluster Management Solution Low admin overhead is hard Cluster name multicast IP / port eg XYZ Cluster 234.3.1.2 : 3535 Allow complex config options via XML Beware automated discovery! eg entire dev team working together Amusing anecdote - first time we brought up a clustered cache, the entire development team became a cluster! 13

2½. Cluster Split Problem Cluster splits into fragments Node Node Node! Each fragment can see DB, but not others Potential for massive data corruption Database Extranet- firewall blocked multicast between machines, but TCPIP traffic to database was fine. 14

Solution 2½. Cluster Split Detect split and shutdown Periodically write a random number to DB and cache Also when nodes join / leave cluster Periodically check that number has not changed If number is detected to have changed, split! Shutdown fragment to all access. Write new number, so others shutdown next check. 15

3. Lucene Problem Indexing vital to all transactional applications Must live on file system Doesn t like network file systems Too slow, writes must be serialized 16

3. Lucene Solutions 1. Dedicated search nodes No longer all nodes identical Have to manage two node classes 17

3. Lucene Solutions 1. Dedicated search nodes 2. One node indexes Batch push of index diffs around cluster Need master/slave - not identical Potential for data loss if index node goes down Index diff sending fragile & complex 18

3. Lucene Solutions 1. Dedicated search nodes Strategy: synchronize 2. One node indexes 3. All nodes index Persistent queue of index operations (in database, no JMS) 2 hour queue (downtime window) If down longer, re-index on join Remember - index is derived data Trade off - work is being done everywhere 19

4. Events Problem Confluence largely event driven internally Event scopes: per cluster - work done on every node Should events be propagated around cluster? per node - work done on originating node 20

4. Events Solution 1. Local listener hears a cluster scoped event eg PluginInstallEvent implements ClusterableEvent 2. Wraps in new ClusterBroadcastEvent 3. Broadcasts CBE around cluster Unreliable messaging (via Tangosol) Offline nodes don t care about events 4. Listeners then listen for ClusterBroadcastEvent Unwrap, check contents, act if necessary (ie plugin install) 21

Solution 4. Events Beware exponential scale problems! Avoid clustered events where possible Use local event + clustered cache Reduce work done everywhere Sometimes not possible - ie classloading 22

Problem 5. Files Efficient to store files on disk Local files not visible to cluster Confluence: Configuration files Attachments Installed plugins Thumbnails Files generated for download (eg charts & PDFs) 23

Solutions 5. Files 1. Network file system / SAN Never as fast as local file system File locking problems Confluence: can t guarantee user has one! Strategy: central share 24

Solutions 5. Files Strategy: central share & temporize 1. Network file system / SAN 2. Use database, remaining files are temporary Config files & attachments moved into database Attachments spooled to local file system to serve Thumbnails, PDFs, charts generated on each node Simpler architecture outweighs duplicated work Trash periodically, regenerate anytime Example of Telenor problem with Xmas party photos and transactions in database bringing Confluence down 25

6. Scheduled Jobs Problem Confluence uses Quartz for scheduled jobs Different job types: delete local temp files - on every node send notification email - once per cluster 26

Solution 6. Scheduled Jobs Divide up jobs into two scopes LocalJob - executed on every node ClusterJob - executed once per cluster Per node - jobs behave as normal Per cluster - ClusterJobStore Implemented new Quartz JobStore Backed by clustered cache Strategy: distributed share 27

7. Testing Problem Automated, repeatable testing is crucial Confluence: Uses Bamboo for continuous integration Automated testing of clusters is hard! 28

Solution 7. Testing Functional Testing Confluence: JWebUnit with switched WebConversations Problems similar to multithreaded testing Cargo to fire multiple web containers 29

7. Testing Solution Load & Performance Testing Repeatable load test Measure continual progress Confluence: Originally reused JWebUnit tests Switched to raw HTTP, less overhead 30

Q&A Java guru? J2EE junkie? Think VB is for drinking? Join the best Java engineering team at Australia s fastest growing software company! http://www.atlassian.com/about/jobs Email me: mike@atlassian.com 31