+ All Categories
Home > Software > Hazelcast Deep Dive (Paris JUG-2)

Hazelcast Deep Dive (Paris JUG-2)

Date post: 15-Apr-2017
Category:
Upload: emrah-kocaman
View: 133 times
Download: 0 times
Share this document with a friend
54
Hazelcast Deep Dive
Transcript
Page 1: Hazelcast Deep Dive (Paris JUG-2)

Hazelcast Deep Dive

Page 2: Hazelcast Deep Dive (Paris JUG-2)

Emrah Kocaman

Software Engineer @ Hazelcastemrahkocaman

[email protected]

Page 3: Hazelcast Deep Dive (Paris JUG-2)

Hazelcast ArchitectureHazelcast Configuration OptionsHazelcast IMap Configuration DetailsHazelcast ClientsHazelcast SerializationQ/A Session

Agenda

Page 4: Hazelcast Deep Dive (Paris JUG-2)

Hazelcast Architecture

Map Set Queue Lock/Sem. Atomics Topic User DefinedMultiMap Ring

Buffer

Web Sessions

Java

C++ .NET

Portable Serialization / Pluggable Serialization

Memcached REST Internal ClientNetwork Protocol

java.util.concurrent.*javax.cache.*Hibernate 2nd Level Cache

Executor ServiceSQL Query Map / Reduce Aggregation

Low-level Services API

Node Engine(Threads, Instances, Eventing, Wait/Notify, Invocation)

Partition Management(Master Partition, Data Affinity, Replicas, Migrations, Partition Groups)

Cluster Management(Multicast, IP List, AWS/OpenStack)

Networking(IPv4, IPv6)

On-heap Storage

Managem

ent Center

(AP

I, JMX

)

Security(C

onnection, Encryption, A

uthentication, Authorization)

WA

N(Topology A

ware P

artition Managem

ent, WA

N R

eplication)

Hazelcast Open Source Hazelcast Enterprise

Predicate Entry Processor

High-Density (HD) Memory Store

Continuous Query

HD Near Cache

Open Client Network Protocol

Hot Restart Store*

* Coming in 3.6

Page 5: Hazelcast Deep Dive (Paris JUG-2)

Hazelcast Configuration Options

XML ConfigurationProgrammatic configurationSpring Configuration

Page 6: Hazelcast Deep Dive (Paris JUG-2)

XML Configuration

Page 7: Hazelcast Deep Dive (Paris JUG-2)

XML Configuration

Page 8: Hazelcast Deep Dive (Paris JUG-2)

XML Configuration

Page 9: Hazelcast Deep Dive (Paris JUG-2)

XML Configuration`hazelcast.config` system property Working directory Classpath Default from Hazelcast.jar

Page 10: Hazelcast Deep Dive (Paris JUG-2)

XML Configuration ClasspathXmlConfig FileSystemXmlConfig InMemoryXmlConfig UrlXmlConfig

Page 11: Hazelcast Deep Dive (Paris JUG-2)

Programmatic Configuration

Page 12: Hazelcast Deep Dive (Paris JUG-2)

Distributed Map Configuration

Page 13: Hazelcast Deep Dive (Paris JUG-2)

Distributed Map Configuration

Page 14: Hazelcast Deep Dive (Paris JUG-2)

IT’S DEMO TIME

Page 15: Hazelcast Deep Dive (Paris JUG-2)

Hazelcast Clients Same intuitive API Similar configuration approach SSL Support Hazelcast Client ProtocolJava, C/C++, .NET, REST, memcache

Page 16: Hazelcast Deep Dive (Paris JUG-2)

IT’S DEMO TIME

Page 17: Hazelcast Deep Dive (Paris JUG-2)

Hazelcast Serialization

Map, Cache, Queue, Set, List Executor Service Entry Processors Lock Topic

Page 18: Hazelcast Deep Dive (Paris JUG-2)

Where it is used?serialization + deserialization

serialization

serialization

serialization

serialization

deserialization

Page 19: Hazelcast Deep Dive (Paris JUG-2)

Optimised TypesByteBooleanCharacterShortIntegerLongFloatDouble

byte[]char[]short[]int[]long[]float[]double[]

StringDateBigIntegerBigDecimalClassEnum

Page 20: Hazelcast Deep Dive (Paris JUG-2)

Hazelcast Serialization

Serializable DataSerializable IdentifiedDataSerializable Portable Pluggable

Page 21: Hazelcast Deep Dive (Paris JUG-2)

Shopping Cart Item

Page 22: Hazelcast Deep Dive (Paris JUG-2)

Shopping Cart

Page 23: Hazelcast Deep Dive (Paris JUG-2)

Benchmark – 100,000 times maxOrders = 100 * 1000

maxCartItem= 5

Page 24: Hazelcast Deep Dive (Paris JUG-2)

java.io.SerializablePros

StandardDoesn’t require any implementation

ConsTakes more time and cpuOccupies more space

Page 25: Hazelcast Deep Dive (Paris JUG-2)

java.io.Serializable - Results

Read Performance31 ops in ms

Write Performance46 ops in ms

Binary object size525 bytes

Page 26: Hazelcast Deep Dive (Paris JUG-2)

java.io.ExternalizablePros

Standard Efficient than Serializable in terms of CPU and

Memory

ConsRequires to implement the actual serialization

Page 27: Hazelcast Deep Dive (Paris JUG-2)

ShoppingCartItem - implementation

Page 28: Hazelcast Deep Dive (Paris JUG-2)

ShoppingCart- implementation

Page 29: Hazelcast Deep Dive (Paris JUG-2)

java.io.Externalizable - Results

Read Performance61 ops in ms

Write Performance60 ops in ms

Binary object size235 bytes

Page 30: Hazelcast Deep Dive (Paris JUG-2)

DataSerializablePros

Efficient than Serializable in terms of CPU and Memory

ConsHazelcast specificRequires to implement the actual serializationUses Reflection while de-serializing

Page 31: Hazelcast Deep Dive (Paris JUG-2)

ShoppingCartItem - implementation

Page 32: Hazelcast Deep Dive (Paris JUG-2)

ShoppingCart- implementation

Page 33: Hazelcast Deep Dive (Paris JUG-2)

DataSerializable- ResultsRead Performance

64 ops in ms

Write Performance59 ops in ms

Binary object size231 bytes

Page 34: Hazelcast Deep Dive (Paris JUG-2)

IdentifiedDataSerializablePros

Efficient than Serializable in terms of CPU and Memory

Doesn’t use Reflection while de-serializing

ConsHazelcast specificRequires to implement the actual serializationRequires to implement a Factory and

configuration

Page 35: Hazelcast Deep Dive (Paris JUG-2)

ShoppingCartItem - implementation

Page 36: Hazelcast Deep Dive (Paris JUG-2)

ShoppingCart- implementation

Page 37: Hazelcast Deep Dive (Paris JUG-2)

IdentifiedDataSerializable – Factory Implementation

Page 38: Hazelcast Deep Dive (Paris JUG-2)

IdentifiedDataSerializable- Results

Read Performance68 ops in ms

Write Performance60 ops in ms

Binary object size186 bytes

Page 39: Hazelcast Deep Dive (Paris JUG-2)

PortablePros

Efficient than Serializable in terms of CPU and MemoryDoesn’t use Reflection while de-serializingSupports versioning Supports partial de-serialization during Queries

ConsHazelcast specificRequires to implement the actual serializationRequires to implement a Factory and Class DefinitionClass definition is also sent together with Data but

stored only once per class

Page 40: Hazelcast Deep Dive (Paris JUG-2)

ShoppingCartItem - implementation

Page 41: Hazelcast Deep Dive (Paris JUG-2)

ShoppingCart- implementation

Page 42: Hazelcast Deep Dive (Paris JUG-2)

Portable – Factory Implementation

Page 43: Hazelcast Deep Dive (Paris JUG-2)

Portable- ResultsRead Performance

65 ops in ms

Write Performance54 ops in ms

Binary object size386 bytes

Page 44: Hazelcast Deep Dive (Paris JUG-2)

Pluggable – (ex: Kryo)

ProsDoesn’t require class to implement an interfaceVery convenient and flexible Can be stream based or byte array based

ConsRequires to implement the actual serializationRequires to plug and configure

Page 45: Hazelcast Deep Dive (Paris JUG-2)

Stream and ByteArray Serializers

Page 46: Hazelcast Deep Dive (Paris JUG-2)

ShoppingCartItem - implementation

Page 47: Hazelcast Deep Dive (Paris JUG-2)

ShoppingCart- implementation

Page 48: Hazelcast Deep Dive (Paris JUG-2)

ShoppingCart Kryo StreamSerializer

Page 49: Hazelcast Deep Dive (Paris JUG-2)

Pluggable Serialization Configuration

Page 50: Hazelcast Deep Dive (Paris JUG-2)

Kryo- ResultsRead Performance

60 ops in ms

Write Performance51 ops in ms

Binary object size210 bytes

Page 51: Hazelcast Deep Dive (Paris JUG-2)

CompressionCompresses the data.

Can be applied to Serializable and Externalizable only.

Very slow (~1000 times) and CPU consuming.

Can reduce 525 bytes to 26 bytes.

Page 52: Hazelcast Deep Dive (Paris JUG-2)

SummarySerializable

R:31 ops/ms, W: 46 ops/ms, Size: 525 bytesExternalizable

R:61 ops/ms, W: 60 ops/ms, Size: 235 bytesDataSerializable

R:64 ops/ms, W: 59 ops/ms, Size: 231 bytesIdentifiedDataSerializable

R:68 ops/ms, W: 60 ops/ms, Size: 186 bytesPortable

R:65 ops/ms, W: 54 ops/ms, Size: 386 bytesKryo

R:60 ops/ms, W: 51 ops/ms, Size: 210 bytes

Page 53: Hazelcast Deep Dive (Paris JUG-2)

Thank you ! :)

[email protected] questions ?

Page 54: Hazelcast Deep Dive (Paris JUG-2)

http://www.zenika.com/formation-hazelcast-essentials.html

30Th November - Free Training


Recommended