More Related Content
Similar to JAXLondon - Squeezing Performance of IMDGs
Similar to JAXLondon - Squeezing Performance of IMDGs (20)
JAXLondon - Squeezing Performance of IMDGs
- 2. Hazelcast co-founder!
Java Developer since 2005!
Worked at Financials and Telco’s. !
Leading Hazelcast Technical Operations.
© 2014 Hazelcast Inc.
About me
2
Follow
me
@fuadm
- 3. Agenda - 50 Minutes + Q&A
© 2014 Hazelcast Inc.
3
Overview to IMDG’s!
Hazelcast Partitioning Basics!
A Shopping Cart Use – Case!
8 possible solutions!
Q&A
- 4. © 2014 Hazelcast Inc.
What is an IMDG?
4
Data Structures(s) in memory!
Distributed across servers !
Highly Available and Resilient!
Horizontal Scalability!
Object based Data Model
- 5. © 2014 Hazelcast Inc.
Why an IMDG?
Performance - RAM is faster than Disk!
Data Structure - linked data model and application code !
Scalability - add servers to scale out RAM and CPU!
Resiliency - seamless recovery from node failures!
API - native, flexible and rich functionality
5
- 6. Popular In-Memory Data Grids
© 2014 Hazelcast Inc.
Oracle Coherence !
Gigaspaces!
Gemfire!
IBM ExtremeScale!
Infinispan!
GridGain!
Hazelcast!
Terracotta*
6
- 9. Partitioning (1 node)
PARTITION_COUNT
=
271
partition_id
=
hash(serialize(key))%PARTITION_COUNT
© 2014 Hazelcast Inc.
9
P_1
P_2
P_271
- 10. Partitioning (2 nodes)
© 2014 Hazelcast Inc.
10
P_1
P_2
P_135
P_136
P_137
P_271
P_136
P_137
P_271
P_1
P_2
P_135
- 11. Partitioning (4 nodes)
© 2014 Hazelcast Inc.
11
P_1
P_2
P_67
P_68
P_69
P_136
P_68
P_137
P_271
P_1
P_138
P_205
P_137
P_138
P_204
P_205
P_206
P_271
P_2
P_69
P_206
P_67
P_136
P_204
- 12. © 2014 Hazelcast Inc.
Example
12
P_1
P_2
P_67
P_68
P_69
P_136
P_68
P_137
P_271
P_1
P_138
P_205
P_137
P_138
P_204
P_205
P_206
P_271
P_2
P_69
P_206
P_67
P_136
P_204
map.put(“LHR”,
“London
Heathrow
Airport”)?
- 13. map.put(“LHR”,
“London
Heathrow
Airport”)?
© 2014 Hazelcast Inc.
Hashing
13
P_1
P_2
P_67
P_68
P_69
P_136
P_68
P_137
P_271
P_1
P_138
P_205
P_137
P_138
P_204
P_205
P_206
P_271
P_2
P_69
P_206
P_67
P_136
P_204
Hash(“LHR”)-‐
>
P_200
- 14. map.put(“LHR”,
“London
Heathrow
Airport”)?
© 2014 Hazelcast Inc.
Hashing
14
P_1
P_2
P_67
P_68
P_69
P_136
P_68
P_137
P_271
P_1
P_138
P_205
P_137
P_138
P_204
P_205
P_206
P_271
P_2
P_69
P_206
P_67
P_136
P_204
1
- 15. map.put(“LHR”,
“London
Heathrow
Airport”)?
© 2014 Hazelcast Inc.
Hashing
15
P_1
P_2
P_67
P_68
P_69
P_136
P_68
P_137
P_271
P_1
P_138
P_205
P_137
P_138
P_204
P_205
P_206
P_271
P_2
P_69
P_206
P_67
P_136
P_204
2
1
- 16. map.put(“LHR”,
“London
Heathrow
Airport”)?
© 2014 Hazelcast Inc.
Hashing
16
P_1
P_2
P_67
P_68
P_69
P_136
P_68
P_137
P_271
P_1
P_138
P_205
P_137
P_138
P_204
P_205
P_206
P_271
P_2
P_69
P_206
P_67
P_136
P_204
2
1
3
- 17. map.put(“LHR”,
“London
Heathrow
Airport”)?
© 2014 Hazelcast Inc.
Hashing
17
P_1
P_2
P_67
P_68
P_69
P_136
P_68
P_137
P_271
P_1
P_138
P_205
P_137
P_138
P_204
P_205
P_206
P_271
P_2
P_69
P_206
P_67
P_136
P_204
2
4
1
3
- 18. © 2014 Hazelcast Inc.
Hashing
18
P_1
P_2
P_67
P_68
P_69
P_136
P_68
P_137
P_271
P_1
P_138
P_205
P_137
P_138
P_204
P_205
P_206
P_271
P_2
P_69
P_206
P_67
P_136
P_204
map.get(“LHR”)?
- 19. © 2014 Hazelcast Inc.
Hashing
19
P_1
P_2
P_67
P_68
P_69
P_136
P_68
P_137
P_271
P_1
P_138
P_205
P_137
P_138
P_204
P_205
P_206
P_271
P_2
P_69
P_206
P_67
P_136
P_204
map.get(“LHR”)?
1
- 20. © 2014 Hazelcast Inc.
Hashing
20
P_1
P_2
P_67
P_68
P_69
P_136
P_68
P_137
P_271
P_1
P_138
P_205
P_137
P_138
P_204
P_205
P_206
P_271
P_2
P_69
P_206
P_67
P_136
P_204
map.get(“LHR”)?
1
2
- 26. © 2014 Hazelcast Inc.
Simulation
26
#[Mean
=
2402.112,
StdDeviation
=
4519.652]
#[Max
=
148504.576,
Total
count
=
56690]
Operations
Per
Second=
5738
- 27. What
is
wrong
here?
© 2014 Hazelcast Inc.
Simulation
27
#[Mean
=
2402.112,
StdDeviation
=
4519.652]
#[Max
=
148504.576,
Total
count
=
56690]
Operations
Per
Second=
5738
- 29. © 2014 Hazelcast Inc.
Lock
29
#[Mean
=
3700.329,
StdDeviation
=
2750.031]
#[Max
=
56918.016,
Total
count
=
27045]
Operations
Per
Second=
2704
- 30. Can
we
improve
this
a
little
bit?
© 2014 Hazelcast Inc.
Lock
30
#[Mean
=
3700.329,
StdDeviation
=
2750.031]
#[Max
=
56918.016,
Total
count
=
27045]
Operations
Per
Second=
2704
- 32. © 2014 Hazelcast Inc.
XA Transaction
32
#[Mean
=
4077.075,
StdDeviation
=
2119.846]
#[Max
=
43155.456,
Total
count
=
24561]
Operations
Per
Second=
2456
- 33. Didn’t
improve
that
much.
Why?
© 2014 Hazelcast Inc.
XA Transaction
33
#[Mean
=
4077.075,
StdDeviation
=
2119.846]
#[Max
=
43155.456,
Total
count
=
24561]
Operations
Per
Second=
2456
- 35. © 2014 Hazelcast Inc.
Local Transaction
35
#[Mean
=
2654.831,
StdDeviation
=
5011.547]
#[Max
=
133955.584,
Total
count
=
56761]
Operations
Per
Second=
5726
- 36. Can
we
do
it
without
a
Transaction?
© 2014 Hazelcast Inc.
Local Transaction
36
#[Mean
=
2654.831,
StdDeviation
=
5011.547]
#[Max
=
133955.584,
Total
count
=
56761]
Operations
Per
Second=
5726
- 38. Compare and swap instead of locking
© 2014 Hazelcast Inc.
38
#[Mean
=
2540.975,
StdDeviation
=
5113.372]
#[Max
=
133365.760,
Total
count
=
60087]
Operations
Per
Second=
6082
- 39. Compare and swap instead of locking
© 2014 Hazelcast Inc.
39
What
other
options
do
we
have?
#[Mean
=
2540.975,
StdDeviation
=
5113.372]
#[Max
=
133365.760,
Total
count
=
60087]
Operations
Per
Second=
6082
- 43. Move operation to data
© 2014 Hazelcast Inc.
43
#[Mean
=
5725.046,
StdDeviation
=
197009.148]
#[Max
=
13639876.608,
Total
count
=
37219]
Operations
Per
Second=
3721
- 44. Move operation to data
© 2014 Hazelcast Inc.
44
#[Mean
=
5725.046,
StdDeviation
=
197009.148]
#[Max
=
13639876.608,
Total
count
=
37219]
Operations
Per
Second=
3721
Can
we
move
it
any
closer?
- 46. © 2014 Hazelcast Inc.
Entry Processor
46
#[Mean
=
1876.355,
StdDeviation
=
1751.857]
#[Max
=
36306.944,
Total
count
=
69648]
Operations
Per
Second=
7018
- 47. Entry Processor Object format
© 2014 Hazelcast Inc.
47
#[Mean
=
1199.272,
StdDeviation
=
1023.777]
#[Max
=
34013.184,
Total
count
=
83520]
Operations
Per
Second=
8352
- 48. HUGL meets tonight!!
https://github.com/fuadm/webinar-TDHW !
Twitter: @fuadm!
https://groups.google.com/forum/#!forum/hazelcast!
http://hazelcast.com/company/careers/!
http://hazelcast.org/learn/
© 2014 Hazelcast Inc.
Questions?
48