<Add your title> Name Title Red Hat, Inc. Date

Similar documents
Monday, November 21, 2011

Infinispan for Ninja Developers

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

Monday, April 25, 2011

Introduction to Infinispan

A memcached implementation in Java. Bela Ban JBoss 2340

Infinispan from POC to Production

Red Hat JBoss Data Grid 7.1 Feature Support Document

{brandname} 9.4 Glossary. The {brandname} community

Our Index. Searching in Infinispan. Infinispan Query engine Clustering a Lucene index Cloud deployed applications Future. Map/Reduce Fulltext indexing

Agenda. Apache Ignite Project Apache Ignite Data Fabric: Data Grid HPC & Compute Streaming & CEP Hadoop & Spark Integration Use Cases Demo Q & A

Red Hat JBoss Data Grid 6.4

Data Management in Application Servers. Dean Jacobs BEA Systems

status Emmanuel Cecchet

Hibernate OGM. Michal Linhard Quality Assurance Engineer, Red Hat. Red Hat Developer Conference February 17 th, 2012

(incubating) Introduction. Swapnil Bawaskar.

About Terracotta Ehcache. Version 10.1

Common JBoss Data Grid Architectures

CS /15/16. Paul Krzyzanowski 1. Question 1. Distributed Systems 2016 Exam 2 Review. Question 3. Question 2. Question 5.

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

CSE 5306 Distributed Systems

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

CSE 5306 Distributed Systems. Fault Tolerance

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

GlassFish High Availability Overview

Distributed Systems. 09. State Machine Replication & Virtual Synchrony. Paul Krzyzanowski. Rutgers University. Fall Paul Krzyzanowski

Chapter 18: Database System Architectures.! Centralized Systems! Client--Server Systems! Parallel Systems! Distributed Systems!

Diplomado Certificación

XTP, Scalability and Data Grids An Introduction to Coherence

Create High Performance, Massively Scalable Messaging Solutions with Apache ActiveBlaze

DISTRIBUTED DATABASE OPTIMIZATIONS WITH NoSQL MEMBERS

Accelerate MySQL for Demanding OLAP and OLTP Use Cases with Apache Ignite. Peter Zaitsev, Denis Magda Santa Clara, California April 25th, 2017

Chapter 20: Database System Architectures

InnoDB: Status, Architecture, and Latest Enhancements

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

Developing Applications with Java EE 6 on WebLogic Server 12c

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

Topics. File Buffer Cache for Performance. What to Cache? COS 318: Operating Systems. File Performance and Reliability

Lecture 23 Database System Architectures

TopLink Grid: Scaling JPA applications with Coherence

<Insert Picture Here> QCon: London 2009 Data Grid Design Patterns

Failure Models. Fault Tolerance. Failure Masking by Redundancy. Agreement in Faulty Systems

Nirvana A Technical Introduction

PolarDB. Cloud Native Alibaba. Lixun Peng Inaam Rana Alibaba Cloud Team

CprE Fault Tolerance. Dr. Yong Guan. Department of Electrical and Computer Engineering & Information Assurance Center Iowa State University

Heckaton. SQL Server's Memory Optimized OLTP Engine

CS5412: TRANSACTIONS (I)

Fault Tolerance Part II. CS403/534 Distributed Systems Erkay Savas Sabanci University

Improvements in MySQL 5.5 and 5.6. Peter Zaitsev Percona Live NYC May 26,2011

Parallel and Distributed Systems. Programming Models. Why Parallel or Distributed Computing? What is a parallel computer?

extreme Scale vs. TayzGrid

A4M36JEE Clustering & Scalability. November 21, 2014

WLS Neue Optionen braucht das Land

<Insert Picture Here>

Lecture 7: February 10

MySQL High Availability. Michael Messina Senior Managing Consultant, Rolta-AdvizeX /

What every DBA needs to know about JDBC connection pools Bridging the language barrier between DBA and Middleware Administrators

Three Models. 1. Time Order 2. Distributed Algorithms 3. Nature of Distributed Systems1. DEPT. OF Comp Sc. and Engg., IIT Delhi

Chapter 8 Fault Tolerance

<Insert Picture Here> Oracle NoSQL Database A Distributed Key-Value Store

J2EE: Best Practices for Application Development and Achieving High-Volume Throughput. Michael S Pallos, MBA Session: 3567, 4:30 pm August 11, 2003

Exam 2 Review. October 29, Paul Krzyzanowski 1

ArcGIS for Server: Administration and Security. Amr Wahba

MySQL Cluster Student Guide

Ignite Key-Value Transactions Architecture

Distributed Systems. Day 13: Distributed Transaction. To Be or Not to Be Distributed.. Transactions

Chapter 11. High Availability

Contents at a Glance. vii

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

<Insert Picture Here> A Brief Introduction to Live Object Pattern

Consistency in Distributed Systems

CIB Session 12th NoSQL Databases Structures

<Insert Picture Here> MySQL Cluster What are we working on

Administration Naive DBMS CMPT 454 Topics. John Edgar 2

) Intel)(TX)memory):) Transac'onal) Synchroniza'on) Extensions)(TSX))) Transac'ons)

Coherence An Introduction. Shaun Smith Principal Product Manager

VMWARE VREALIZE OPERATIONS MANAGEMENT PACK FOR. Amazon Aurora. User Guide

Craig Blitz Oracle Coherence Product Management

The new Ehcache and Hibernate Caching SPI Provider

About BigMemory Go. Innovation Release. Version 4.3.5

Boost Your Hibernate and Application Performance

CSE 544 Principles of Database Management Systems. Alvin Cheung Fall 2015 Lecture 14 Distributed Transactions

PART B UNIT II COMMUNICATION IN DISTRIBUTED SYSTEM PART A

Datacenter replication solution with quasardb

MySQL for Database Administrators Ed 3.1

User Datagram Protocol

PaaS Cloud mit Java. Eberhard Wolff, Principal Technologist, SpringSource A division of VMware VMware Inc. All rights reserved

Distributed Systems. Fall 2017 Exam 3 Review. Paul Krzyzanowski. Rutgers University. Fall 2017

Realtime visitor analysis with Couchbase and Elasticsearch

White Paper. Major Performance Tuning Considerations for Weblogic Server

Distributed Data Management Transactions

Fault Tolerance. Basic Concepts

Scale out Read Only Workload by sharing data files of InnoDB. Zhai weixiang Alibaba Cloud

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

elasticsearch The Road to a Distributed, (Near) Real Time, Search Engine Shay Banon

DISTRIBUTED FILE SYSTEMS & NFS

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

<Insert Picture Here> Oracle Application Cache Solution: Coherence

Distributed Systems Multicast & Group Communication Services

MYE017 Distributed Systems. Kostas Magoutis

Transcription:

<Add your title> Name Title Red Hat, Inc. Date 1

Introduction What is Infinispan? Principle use cases Key features Hands-on demo Agenda build an application using infinispan Extras Querying the Grid Database - OGM Performance tuning - RadarGun Conclusion

Lab Setup Download the lab zip: http://bit.ly/infinispan-labs-checkpoint1 Unzip the lab to your disk to a location of your choice If you are a git user, you can clone the repository: g i t c l o n e g i t : / / g i t h u b. c o m / p m u i r / i n fi n i s p a n - l a b s. g i t each stage of this lab has a checkpoint which is tagged, g i t c h e cyou k o u t Ccan h e c k pcheck o i n t X out the code for each Checkpoint using:

Lab Setup Follow along using http://bit.ly/infinispan-labs Download JBoss AS 7.0.2 from http://jboss.org/jbossas/downloads Unzip JBoss AS to your disk to a location of your choice

Introduction

So what is Infinispan? Distributed, in memory, data structure Highly available Elastic Open source

Distributed Data structure

High availability Memory is volatile Make redundant copies Total replication (Replication Mode) Partial replication (Distribution Mode) Topology changes Node will crash! Re-arrange state

Elasticity Expect Node additions Node removals Topology changes are totally consistent do not "stop the world"

Access modes Embedded client and node on same VM fast! Client/server different processes multiple protocols REST Memcached Hotrod

Embedded access

Client/server access Server endpo - REST - Memcached - Hotrod

Main use cases Local cache e.g. Hibernate 2nd level cache Cluster of caches More caching capacity Co-located clients Data Grid dedicated cluster of servers remote access

Good old caching... Local cache java.util.map And some more eviction expiry write through/behind passivation preloading notifications

Use Case 1: Local Cache

Use Case 2: Cluster of caches

Use Case 3: Data grid

Use Case 3: Data grid

Key features Cloud oriented Transactions Querying Map/Reduce and Dist Executors Cache loaders Management JMX RHQ

Hands on Demo

Reliable Multipoint Communication

Why do you care?

Shall we try it out? In the lab project you'll find a test script for your network. Run it! LAB_HOME/nic-test If all goes well, you'll get two windows in which you can draw up on your screen. Draw on one, see it in both. Easy to try: JGroups has no dependencies!

What is unreliable? Messages get dropped too big (UDP has a size limit), no fragmentation buffer overflow at the receiver, switch reordered NIC, IP network buffer We don't know who is in a cluster (IP multicast) we don't know when a new node joins, leaves, or crashes Fast sender might overwhelm slower receiver(s) flow control

So what Is JGroups? Library for reliable cluster communication Provides Fragmentation Message retransmission Flow control Ordering Group membership, membership change notification LAN or WAN based IP multicasting transport default for LAN TCP transport default for WAN Autodiscovery of cluster members

Overview reliable unreliable unicast TCP / JGroups java.net.socket java.net.serversocket org.jgroups.channel) UDP java.net.datagramsocket multicast JGroups org.jgroups.channel IP Multicast java.net.multicastsocket

Architecture of JGroups send receive send receive Channel Channel STATE COMPRESS FLOW NAKACK FRAG UDP STATE COMPRESS FLOW NAKACK FRAG UDP Network

Terminology Message Address View State transfer Group topology

Address A cluster consists of a number of members Each member has an Address The address uniquely identifies the member Address is an abstract class Implemented as a UUID A UUID maps to a physical address An address can have a logical name E.g. A If not set, JGroups picks the name, e.g. myhost- 16524

View List of members (Addresses) Is the same in all members: A: {A,B,C} B: {A,B,C} C: {A,B,C} (Same elements, same order) Updated when members join or leave

Group topology

Available protocols Transport UDP (IP multicasting), TCP, TCP_NIO, Message batching Merging, failure detection (hangs, crashes) Reliable transmission and ordering Using sequence numbers, dropped messages are retransmitted Distributed garbage collection Consensus on received messages, older ones are purged

Available protocols Group membership Installs new views across a cluster when members join, leave or crash Flow control Fast sender is throttled down to the pace of the slowest receiver Fragmentation Large packets are fragmented into smaller ones and unfragmented at the receiver side Compression, encryption, authentication

Available protocols State transfer State transferred to a joining member without stopping the cluster Virtual Synchrony All messages sent in view V1 are delivered in V1 Flushes unstable messages before a new view is installed Makes sure all members have received all messages sent in V1 before installing V2 Ordering: total, causal, FIFO

Discovery Protocols PING, MPING, BPING,.. TCP_PING JDBC_PING S3_PING CASSANDRA_PING

Eviction and expiration

Expiration Time based lifespan max idle Expired entries removed from cache from persistent store (if any)

API

Configuration

Eviction Memory is finite something has to give! Evict based on data access Bounded caches

Eviction strategies None (default) Unordered FIFO LRU LIRS

LIRS Low Inter-reference Recency Set replacement Hybrid frequency of access time of the last access

Passivation Evict to external store file, database... Cheaper than remote access (?) Use the right eviction policy keep relevant bits in memory

Configuration

Tuning eviction What eviction policy should I use? Measure, don t guess Cache JMX stats hits/misses ratio Memory issues? Aggressive wakeup interval

Listeners

Listener types Cache listeners data: added, remove, changed, entry loaded transaction: completed, registered topology: changed, data rehashed Cache manager listeners cache started/stopped, view changed/merge

Synchronicity listener executes in caller s thread (default) keep it short! Or async

Listeners are local Can veto an operation Participate in transactions Do not work on RemoteCacheManager

Transactions

Agenda Transactions optimistic/pessimistic JTA support XA (or not) Recovery Deadlock avoidance

Cache types Non transactional Transactional optimistic pessimistic TransactionManager required No mixed-access

Transactional caches Optimistic no locks before prepare small lock scope Pessimistic lock acquired on each write writes block writes reads do not block locks held longer

Pessimistic or Optimistic? Optimistic low contention high contention -> many rollbacks disable version check Pessimistic high key contention rollbacks are less desirable more costly/more guarantees

JTA integration JTA transactions known API Multiple options full xa (XAResource) less strict (Synchronization)

XA or not? XA proper distributed transactions recovery enabled or not Synchronization cache backed by a data store Transaction more efficient 1PC optimisation TransactionManager not writing logs Hibernate 2LC

Recovery When is needed? prepare successful, commit fails inconsistent state! How to handle it TransactionManager informs SysAdmin JMX tooling exposed to force commit force rollback

Deadlocks Deadlock Tx1: a -> b Tx2: b -> a right timing Bad for system throughput threads blocked until (one) tx timeouts lockacquisitiontimeout defaults to 10 seconds! a,b are locked during this time -> potentially more deadlocks

What s to be done? Order key e.g. lexicographically Tx1: a -> b Tx2: a -> b not always possible Use deadlock detection fail fast one tx succeeds

New deadlock avoidance techniques (5.1) Single lock owner avoid same key-deadlocks Optimistic only Incremental locking acquire locks on the same node sequence Lock reordering based on consistent hash

Modes of Operation

Consistent Hashing: DIST

Clustering: Cache modes DIST Sync/Async REPL Sync/Async LOCAL INV Doesn't have async Sync/Async

DIST again

DIST + VNodes

Client Server

Peer to peer

Client/Server Architecture Supported Protocols REST Memcached Hot Rod

Hotrod?! Wire protocol for client server communications Open Language independent Built-in failover and load balancing Smart routing xa support - to come

Server Endpoint Comparison Protocol Client Libraries Clustered? Smart Routing Load Balancing/Failover REST Text N/A Yes No Any HTTP load balancer Memcached Text Plenty Yes No Only with predefined server list Hot Rod Binary Java, Python Yes Yes Dynamic

Client/Server - when? Client not affected by server topology changes Multiple apps share the same grid Tier management incompatible JVM tuning security Non-JVM clients

Cache Stores

Why use cache stores? Durability More caching capacity Warm caches preload

Features Chaining more than one per cache Passivation with eviction Async write behind Shared

Types of cache stores File system FileCacheStore BdbjeCacheStore JDBC Cloud cache store (JCouds)

More cache stores RemoteCacheStore use Hotrod Cassandra ClusterCacheStore alternative to state transfer Custom!

Extras

Map Reduce & Distributed Executors

Distributed Executors public interface DistributedExecutorService extends ExecutorServi <T, K> Future<T> submit(callable<t> task, K... input); <T> List<Future<T>> submiteverywhere(callable<t> task); <T, K > List<Future<T>> submiteverywhere(callable<t> task, K... input); } public interface DistributedCallable<K, V, T> extends Callable<T> void setenvironment(cache<k, V> cache, Set<K> inputkeys); }

However,behind the scenes..

Do not forget Gene Amdahl Speedup = 1/(p/n)+(1- p) However, problems that increase the percenta of parallel time with their size are more scalabl than problems with fixed percentage of paralle time p = parallel fraction n = number of proce ource: ttps://computing.llnl.gov/tutorials/parallel_comp/

π approximation

Infinispan MapReduce We already have a data grid! Leverages Infinispan s DIST mode Cache data is input for MapReduce tasks Task components: Mapper, Reducer, Collator MapReduceTask cohering them together

Source: http://labs.google.com/papers/mapreduce.html MapReduce model

Mapper, Reducer, Collator public interface Mapper<KIn, VIn, KOut, VOut> extends Serializable { } void map(kin key, VIn value, Collector<KOut, VOut> collector); public interface Reducer<KOut, VOut> extends Serializable { } VOut reduce(kout reducedkey, Iterator<VOut> iter); public interface Collator<KOut, VOut, R> { } R collate(map<kout, VOut> reducedresults);

Querying

To query a Grid What's in C7? O b j e c a c c t h p e =. g e t ( c 7 ) ; Where is the white King?

Infinispan and Queries How to query the grid Key access Statistics Map/Reduce Indexing of stored objects Integrate with existing search engines Scale Highly available

Indexing of stored objects Maven module: infinispan-query Configuration: indexing=true Will trigger on annotated objects Integrates hibernate-search-engine Based on Apache Lucene

Enable indexing C o n fi g u r a t i o n c = n e w C o n fi g u r a t i o n ( ). fl u e n t ( ). i n d e x i n g ( ). a d d P r o p e r t y ( " h i b e r n a t e. s e a r c h. o p t i o n ", " v a l u e " ). b u i l d ( ) ; C a c h e M a n a g e r m a n a g e r = n e w D e f a u l t C a c h e M a n a g e r ( c ) ;

Annotate your objects @ProvidedId @Indexed p u b l i c c l a s s Book i m p l e m e n t s S e r i a l i z a b l e { @Field S @Field S @Field S... t r i n g title; t r i n g author; t r i n g editor; }

Search them! e a r c h M a n a g e r s m = S e a r c h. g e t S e a r c h M a n a g e r ( c a c h e ) ; u e r y q u e r y = s m. b u i l d Q u e r y B u i l d e r F o r C l a s s ( B o o k. c l a s s ). g e t ( ). p h r a s e ( ). o n F i e l d ( " t i t l e " ). s e n t e n c e ( " i n a c t i o n " ). c r e a t e Q u e r y ( ) ; i s t < O b j e c t > l i s t = s m. g e t Q u e r y ( q u e r y ). l i s t ( ) ;

Lucene API, storing in Infinispan

Limited write concurrency

Example of multi-cache app

OGM: Object/Grid Mapper Implements JPA for NoSQL engines Infinispan as first supported engine More coming Simplified migration across different NoSQL, SQL databases With transactions, or whatever is possible. Fast? Contribute tests and use cases!

JPA on NoSQL: an approach with Hibernate OGM Devoxx 2011 November 17th (conf Day 4) - 14:00 15:00 Emmanuel Bernard

Radargun

What is Radargun? Benchmarking tool in memory data grids Pluggable products data access patterns

Basic Idea

Status 1.0 Released Web session replication Transaction benchmarks run on 100+ nodes 1.1 on the way TPC-C plugin for tx benchmarking consistent hash efficiency

Conclusion

Use Cases Local Cache Distributed Cache Data Grid

Access Modes Embedded Remote Hot Rod REST Memcache

Control Eviction Expiration Management

Transaction & Locking XA Local

Cache Stores Persistence

Q&A