Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Distributed Computing with Hazelcast - Brazil Tour

1,261 views

Published on

This slidedeck is a new version of the Distributed Computing, Distributed Caching JUG deck.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Distributed Computing with Hazelcast - Brazil Tour

  1. 1. www.hazelcast.com@noctarius2k /** * Distributed Computing * with Hazelcast */
  2. 2. www.hazelcast.com@noctarius2k Interactive!
  3. 3. www.hazelcast.com@noctarius2k
  4. 4. www.hazelcast.com@noctarius2k Disclaimer # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x00002aaaaaf6d9c3, pid=2185, tid=1086892352 # # JRE version: 6.0_21-b06 # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 ) # # An error report file with more information is saved as: # /path/to/hs_err_pid2185.log # # This 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.
  5. 5. www.hazelcast.com@noctarius2k Who’s that dude? • Chris(toph) Engelbert • Twitter fanatic: @noctarius2k • Weird 9+ Java-Years • Performance, GC, Fairytales • Apache Committer • Gaming, Travel Management, …
  6. 6. www.hazelcast.com@noctarius2k • Chris(toph) Engelbert • Twitter fanatic: @noctarius2k • Weird 9+ Java-Years • Performance, GC, Fairytales • Apache Committer • Gaming, Travel Management, … The www.hazelcast.ninja Who’s that dude?
  7. 7. www.hazelcast.com@noctarius2k Distributed Computing…
  8. 8. www.hazelcast.com@noctarius2k Toaster Server 1 TV-Server 1 Power
 CoffeeMaker Server 1 Kettle Server 1 Stove Server 1 Power Grid Server 1, 2 Distributed Computing…
  9. 9. www.hazelcast.com@noctarius2k … but what means Distributed Computing?OOO ( )
  10. 10. www.hazelcast.com@noctarius2k
  11. 11. www.hazelcast.com@noctarius2k “In-Memory Computing”
  12. 12. www.hazelcast.com@noctarius2k ‘In-Memory Computing’ 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
  13. 13. www.hazelcast.com@noctarius2k Evolution of: - Memory-Price - Memory-Size
  14. 14. www.hazelcast.com@noctarius2k Data Distribution (Partitioning / Sharding)
  15. 15. www.hazelcast.com@noctarius2k Data Distribution String code = “JCP-TOUR-2015” Map<String, TShirtDelivery> shirts = Maps.create() shirts.put(code, new TShirtDelivery(“Your Address”))
  16. 16. www.hazelcast.com@noctarius2k Data Distribution String code = “JCP-TOUR-2015” int hashcode = hash(code) partitionId = hashcode % partitionCount cluster.send(partitionId, code, delivery)
  17. 17. 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
  18. 18. www.hazelcast.com@noctarius2k Demo Time
  19. 19. www.hazelcast.com@noctarius2k That was easy!But don’t tell anyone!
  20. 20. www.hazelcast.com@noctarius2k Parallelize Processing
  21. 21. 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()
  22. 22. 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)
  23. 23. www.hazelcast.com@noctarius2k Demo Time 2
  24. 24. www.hazelcast.com@noctarius2k I told you: Easy Peasy!
  25. 25. www.hazelcast.com@noctarius2k Distributed Caching!
  26. 26. www.hazelcast.com@noctarius2k Collect, store …
  27. 27. www.hazelcast.com@noctarius2k …access fast when necessary!…access fast when necessary!
  28. 28. www.hazelcast.com@noctarius2k Caches
  29. 29. www.hazelcast.com@noctarius2k Evolution Of Caching Custom
  30. 30. www.hazelcast.com@noctarius2k http://gadizmo.com/roll-your-own-with-the-ham-dogger.php Roll Your Own! Evolution Of Caching
  31. 31. 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); } }
  32. 32. www.hazelcast.com@noctarius2k Even With TTL!
  33. 33. www.hazelcast.com@noctarius2k And Auto-Cleanup
  34. 34. www.hazelcast.com@noctarius2k What Is Wrong?
  35. 35. www.hazelcast.com@noctarius2k What Is Wrong? O(n) 5 mio Entries
  36. 36. www.hazelcast.com@noctarius2k It was a trap!
  37. 37. www.hazelcast.com@noctarius2k Evolution Of Caching Custom
  38. 38. www.hazelcast.com@noctarius2k Proprietary Evolution Of Caching Custom
  39. 39. www.hazelcast.com@noctarius2k Proprietary Evolution Of Caching Open Source Custom
  40. 40. www.hazelcast.com@noctarius2k Proprietary Evolution Of Caching Open Source Commercial Custom
  41. 41. www.hazelcast.com@noctarius2k Proprietary Evolution Of Caching Open Source Commercial Stupidly Expensive Custom
  42. 42. www.hazelcast.com@noctarius2k http://technoodling.net/mili-power-crystal-battery-pack-review/ Terracotta / EHcache Oracle Coherence Infinispan Java Collections API Hazelcast JCache Custom
  43. 43. www.hazelcast.com@noctarius2k Success! Feels like
  44. 44. www.hazelcast.com@noctarius2k Quick Shameless Plug :) Hazelcast!
  45. 45. 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)
  46. 46. www.hazelcast.com@noctarius2k Time to be Happy!
  47. 47. www.hazelcast.com@noctarius2k Time to be Happy! Apache License 2
  48. 48. www.hazelcast.com@noctarius2k Time to be Happy! www.hazelcast.org
  49. 49. www.hazelcast.com@noctarius2k You can do it!
  50. 50. www.hazelcast.com@noctarius2k Thank You! Any Questions? @noctarius2k http://www.sourceprojects.org http://github.com/noctarius @hazelcast http://www.hazelcast.com http://www.hazelcast.org http://github.com/hazelcast
  51. 51. www.hazelcast.com@noctarius2k Thank You! Any Questions? @noctarius2k http://www.sourceprojects.org http://github.com/noctarius @hazelcast http://www.hazelcast.com http://www.hazelcast.org http://github.com/hazelcast Free Hazelcast T-Shirt http://bit.ly/tshirtcast
  52. 52. www.hazelcast.com@noctarius2k Thank You! Any Questions? @noctarius2k http://www.sourceprojects.org http://github.com/noctarius @hazelcast http://www.hazelcast.com http://www.hazelcast.org http://github.com/hazelcast Free Hazelcast T-Shirt http://bit.ly/tshirtcast We’re hiring! www.hazelcast.com/careers

×