in-memory computing - distributed systems - devoxx uk 2015
TRANSCRIPT
www.hazelcast.com
DisclaimerThis presentation may include certain forward-looking statements and projections provided by the Company. Any such statements and projections reflect various
estimates and assumptions by the Company concerning anticipated results. These statements involve risks, uncertainties and assumptions and are based on the
current estimates and assumptions of the management of the Company as of the date of this presentation and are subject to uncertainty and changes. No
representations or warranties are made by the Company as to the accuracy of any such statements or projections. Whether or not any such forward-looking statements or projections are in fact achieved will depend upon future events some of which are not within the control of the Company. Accordingly, actual results may vary from the projected results and such variations may be material. Statements contained herein describing documents and agreements are summaries only and such summaries
are qualified in their entirety by reference to such documents and agreements.
www.hazelcast.com
Who’s that dude?
• Chris(toph) Engelbert • Twitter fanatic: @noctarius2k • Weird 9+ Java-Years • Performance, GC, Fairytales • Apache Committer • Gaming, Travel Management, …
www.hazelcast.com
Who’s that dude?
• Chris(toph) Engelbert • Twitter fanatic: @noctarius2k • Weird 9+ Java-Years • Performance, GC, Fairytales • Apache Committer • Gaming, Travel Management, …
The www.hazelcast.ninja
www.hazelcast.com@noctarius2k
ToasterServer 1
TV-Server 1Power
CoffeeMakerServer 1
Kettle Server 1
StoveServer 1
Power GridServer 1, 2
DistributedComputing…
www.hazelcast.com@noctarius2k
‘In-Memory’ -Don’t you mean ‘Wasting Memory’?
L1 Cache Reference L2 Cache Reference Main Memory Reference 1K send over 1 Gbps Network 4K read from SSD Seek on Spinning Disk Send Packet CA->AMS->CA
0.5 ns 7 ns
100 ns 10,000 ns
150,000 ns 10,000,000 ns
150,000,000 ns
0.01 ms 0.15 ms
10 ms 150 ms
www.hazelcast.com@noctarius2k
Data Distribution
String code = “devoxx.co.uk”
Map<String, TShirtDelivery> shirts = Maps.create()
shirts.put(code, new TShirtDelivery(“Your Address”))
www.hazelcast.com@noctarius2k
Data Distribution
String code = “devoxx.co.uk”
int hashcode = hash(code)
partitionId = hashcode % partitionCount
cluster.send(partitionId, code, delivery)
www.hazelcast.com@noctarius2k
Data Distribution
int hashcode = hash(code)
partitionId = hashcode % partitionCount
cluster.send(partitionId, code, delivery)
Must be a consistent hash function
Partition count must be constant
Can be calculated, smart routing possible
www.hazelcast.com@noctarius2k
Parallelize Processing
int[] values = [0..100000].map(randomInt())
int[][] blocks = split(values, 10000)
int[] subresult = blocks.foreach(_.sum())
int result = subresult.sum()
www.hazelcast.com@noctarius2k
Parallelize Processing
int[][] blocks = split(values, 10000)
int[] subresult = blocks.foreach(_.sum())
int result = subresult.sum()
No mutation, only new values
Independently computable
Might split further down (fork-join, work-stealing)
www.hazelcast.com@noctarius2k
http://gadizmo.com/roll-your-own-with-the-ham-dogger.php
Roll Your Own!Evolution Of Caching
www.hazelcast.com@noctarius2k
Caches Are Simple!
public class Cache<K, V> { private final Map<K, V> cache = new CHM<>();
public void put(K key, V value) { cache.put(key, value); }
public V get(K key) { return cache.get(key); }
}
www.hazelcast.com@noctarius2k
Proprietary Cache!
Evolution Of Caching
Open Source
Commercial
Stupidly Expensive
www.hazelcast.com@noctarius2k
http://technoodling.net/mili-power-crystal-battery-pack-review/
Terracotta /EHcache
OracleCoherence
Infinispan
JavaCollections
API
Hazelcast
JCache
www.hazelcast.com@noctarius2k
Want to know moreabout #JCache?
Gimme CachingThe Distributed JCache (JSR107) Way
17:00 - 17:50 - Room Exec Centre
David Brimley
www.hazelcast.com@noctarius2k
Hazelcast in 5 Facts• Java Collections API• Java Concurrency API
• Transparent Data Distribution• Drop-In Replacement
• Disruptively Simple(c) Rod Johnson (@springrod)