+ All Categories
Home > Documents > Red Hat JBoss Data Grid

Red Hat JBoss Data Grid

Date post: 01-Feb-2022
Category:
Upload: others
View: 6 times
Download: 0 times
Share this document with a friend
47
Transcript
Page 1: Red Hat JBoss Data Grid
Page 2: Red Hat JBoss Data Grid

Red Hat JBoss Data Grid &the Hibernate Suite: A Love Affair

Sanne Grinovero Senior Software Engineer, Red HatJune 13, 2013

Page 3: Red Hat JBoss Data Grid

Goals

● Overview of existing integrations Hibernate / JBoss Data Grid

● Familiarize with JBoss Data Grid concepts● What problems could these integrations

solve for you

Page 4: Red Hat JBoss Data Grid

Who am I?

Engineering team: Hibernate● Hibernate Search lead● Hibernate OGM team● Hibernate ORM

● Query parser and performance

● Infinispan● Contributor for fun and need● Designed some recent improvements● Driving some of the Hibernate and Apache Lucene integrations

● @SanneGrinovero on Twitter

Page 5: Red Hat JBoss Data Grid

Why am I standing here?

I'm not a spokesman.

Nor a designer.

Page 6: Red Hat JBoss Data Grid
Page 7: Red Hat JBoss Data Grid

Common mistake:Need to avoid lazy loading with custom fetching

Page 8: Red Hat JBoss Data Grid

select b from Book bjoin fetch b.publishedIn

where b.id = :bookId

Page 9: Red Hat JBoss Data Grid

Measure the Effect, avoid generalization

● Cool we avoided some SQL statements

● What on the network payload?

● Is the RDBMS happier?

Page 10: Red Hat JBoss Data Grid

Better: avoid any pointless loading

Page 11: Red Hat JBoss Data Grid

select b from Book bwhere b.id = :bookId

Page 12: Red Hat JBoss Data Grid

Love affair 1# @Cache ?

● 2nd level

● Choice of implementations

● HashTable● Ehcache● Infinispan

● Available on multiple levels

● Entity● Relation● Query

Page 13: Red Hat JBoss Data Grid

How to start cheating

● Enable caching on entities

● .. and/or relations

● hibernate.cache.use_second_level_cache = true

Page 14: Red Hat JBoss Data Grid

TX / secondbenchmark - JBoss EAP 6.1

1 User10 Users

20 Users30 Users

40 Users50 Users

60 Users70 Users

80 Users90 Users

100 Users110 Users

120 Users130 Users

140 Users150 Users

160 Users170 Users

180 Users190 Users

200 Users

0

1000

2000

3000

4000

5000

6000

7000

8000

Page 15: Red Hat JBoss Data Grid

Average Response timebenchmark - JBoss EAP 6.1

1 User10 Users

20 Users30 Users

40 Users50 Users

60 Users70 Users

80 Users90 Users

100 Users110 Users

120 Users130 Users

140 Users150 Users

160 Users170 Users

180 Users190 Users

200 Users

0

10

20

30

40

50

60

Page 16: Red Hat JBoss Data Grid

What kind of data structure do we need for the Cache?

Page 17: Red Hat JBoss Data Grid

What is ?

● Community project

● A high performance cache

● A NoSQL database: a key-value store

● Just another...

java.util.Map<K, V>

java.util.concurrent.ConcurrentMap<K, V>

javax.cache.Cache<K, V>

Page 18: Red Hat JBoss Data Grid

Infinispan Cache Modes

● Local

● Invalidation

● Replication

● Distribution

Page 19: Red Hat JBoss Data Grid

2nd level cache: Invalidation

Page 20: Red Hat JBoss Data Grid

JBoss Data Grid?

Page 21: Red Hat JBoss Data Grid

Remote access

● Multiple protocols

● Not only clients in JVM

Page 22: Red Hat JBoss Data Grid

Remote clients to Data Grid

Page 23: Red Hat JBoss Data Grid

Library Mode

Page 24: Red Hat JBoss Data Grid

Linear scalability by design

● Linear throughput

● Linear capacity

● Linear processing

Page 25: Red Hat JBoss Data Grid

A simple but powerful local cache

Page 26: Red Hat JBoss Data Grid

Excellent for caching

● Low Inter-reference Recency Set (LIRS)● http://dl.acm.org/citation.cfm?id=511334.511340

● Transactional

● Reliable

● High performance

● Multiple nodes via JGroups● Dynamic topology● Discovery● Cloud friendly networking

Page 27: Red Hat JBoss Data Grid

Love affair 2# sharing a powerful Search Engine

Page 28: Red Hat JBoss Data Grid

Why Apache Lucene?

● Extremely efficient

● Very reliable, great community

● Flexible and extensible

● Apache Licensed OSS

● Not just queries

Results returned in order of releveance

Page 30: Red Hat JBoss Data Grid

Faceting

Page 31: Red Hat JBoss Data Grid

Filters: declarative, stacking, reusable

Page 32: Red Hat JBoss Data Grid

@Spatial: geospatial distance filtering and sorting

Page 33: Red Hat JBoss Data Grid

Hibernate Search & JBoss Data Grid queries:same engine, same queries

● Same underlying technology

● Same API to learn

● Same indexing configuration options

Page 34: Red Hat JBoss Data Grid

There is one catch: an index to maintain

● The typical Lucene index is stored on filesystem

● A Lucene index is not easy to replicate on multiple nodes (nor efficient)

● Write operations require an exclusive lock

Page 35: Red Hat JBoss Data Grid

Async replication delegating writes to a master

Page 36: Red Hat JBoss Data Grid

Love affair 3# storing the index in the Data Grid

Page 37: Red Hat JBoss Data Grid

Real-Time replication by storing the index in the JBoss Data Grid

Page 38: Red Hat JBoss Data Grid

Is it fast?

Page 39: Red Hat JBoss Data Grid

The Lucene Directory can be used independently

This unlocks the Red Hat JBoss Data Grid as a platform for even more complex distributed data mining tasks on natural language and classification

Page 40: Red Hat JBoss Data Grid

Durability

Page 41: Red Hat JBoss Data Grid

Love affair 4# Infinispan delegating to Hibernate persistence

● JPA CacheStore available in community Infinispan 5.3

Page 42: Red Hat JBoss Data Grid

Love affair 5# The really cool stuff...

(not a product yet)

Page 43: Red Hat JBoss Data Grid

● Replace your RDBMS, keep the persistence layer

● JPA / Hibernate API for any NoSQL

● Standards compliant

● Influenced by the relational model

● Does queries too (gradual ramp up)

● Not much new to learn

● Same well known API, same integration options

Page 44: Red Hat JBoss Data Grid

What it does

● JPA front end for:

● Infinispan, Ehcache

● MongoDB

● Coming next: Neo4J, Cassandra, CouchDB

● CRUD support for @Entities

• Full-text queries by using Hibernate Search

● JP-QL queries (simple ones)

Future● More complex JP-QL

support

● Hybrid storage

Page 45: Red Hat JBoss Data Grid

How it looks

Page 46: Red Hat JBoss Data Grid

Review

● In products:● 2nd level caching● Search engine● Storing Apache Lucene

indexes in the Jboss Data Grid

● In community only:● Infinispan with

Write-through to JPA● Infinispan to replace the

database

Page 47: Red Hat JBoss Data Grid

Mentioned today

● The products● Red Hat JBoss Data Grid

http://red.ht/data-grid

● JBoss Web Framework Kit

● JBoss Enterprise Application Platform

● The projects● Infinispan● Hibernate● Hibernate Search● Hibernate OGM● Apache Lucene

More: Replication Between Datacenters with Red Hat JBoss Data GridBela Ban — Consulting Software Engineer, Red HatRoom 207 — Thursday, June 13, 2:30 pm - 3:30 pm (right now)


Recommended