Jax London 2013

813 views

Published on

Fast Data: Parallel Processing on the Grid.

You may think of in-memory datagrids as a big cache, a key value store accessed using put and get. However to really reap the power and scale of modern data grids you need to move beyond cache semantics and turn your architecture on its head. Moving the processing to the data rather than pulling the data across the grid massively increases parallelism and reduces network latency, leading to huge increases in throughput. In this session, we will explore why traditional cache semantics sometimes struggles to scale and how through using parallel processing and event processing on the grid we can rearchitect our systems for massive scalability and utilise all our grid cores for parallel processing.

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
813
On SlideShare
0
From Embeds
0
Number of Embeds
44
Actions
Shares
0
Downloads
5
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Without computation you just have a big cache!Good but not radical!Very Expensive to pull all the data across the grid. Could be Gigabytes of data you pull across the network.
  • Moves the processing the the data not the other way around!Much more efficient and the processor will likely have a small amount of data associated with it whereas the cache size may be very large!
  • Jax London 2013

    1. 1. Steve Millidge | C2B2 Fast Data: Parallel Processing on the Grid
    2. 2. SAFE HARBOR This talk may contain nonsense. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    3. 3. WHO AM I Founder C2B2 Java since 1.0 EG Member JSR107 and JSR347 (bit dead) Our Mission We ensure the middleware that forms the foundation of our customer’s mission critical systems is Fast, Reliable, Manageable and Secure. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    4. 4. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    5. 5. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    6. 6. Diagnose Before You Prescribe www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    7. 7. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    8. 8. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    9. 9. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    10. 10. Can you add more? CPU Disk Memory Bandwidth www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    11. 11. Ability to add more capacity in response to more demand. Without a reduction in performance! 900 800 700 600 500 Linear Scalability 400 Typical Scalability 300 200 100 0 1 www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting 2 3 4 The Leading Independent Middleware Experts
    12. 12. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    13. 13. Time delay in requesting an operation and it being initiated www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    14. 14. 1Gb Ethernet : 25 – 30MB/s 10Gb Ethernet : 250 – 350MB/s Infiniband : 6GB/s (maybe) www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    15. 15. PING TIMES Local : 57µs LAN segment : 300µs LAN: switches : 4ms UK : 30ms USA : 100ms 3G : 100s ms www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    16. 16. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    17. 17. Spinning Rust Source: tomshardware.com Typical SSD Speed 540MB/s www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting Disk BUS Speeds SATA 1.0 : 150MB/s SATA 2.0 : 300MB/s SATA 3.0 : 600MB/s SAS : 600MB/s Fibre Channel : 1GB/s Infiniband : 1GB/s The Leading Independent Middleware Experts
    18. 18. DDR3 1600 : 12.8GB/s www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    19. 19. Source www.cs.virginia.edu Approx: 3-5GB/s per cpu still about 1 order magnitude faster than SSD and scales with cores The general rule for STREAM is that each array must be at least 4x the size of the sum of all the last-level caches used in the run, or 1 Million elements -- whichever is larger. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    20. 20. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    21. 21. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    22. 22. “As an extreme example, several current highend machines run simple arithmetic kernels for out-of-cache operands at 4-5% of their rated peak speeds --- that means that they are spending 95-96% of their time idle and waiting for cache misses to be satisfied” http://www.cs.virginia.edu/stream/ref.html www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    23. 23. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    24. 24. Other manufacturers are available ;-) XF PREMIUM LUXURY Settle into soft grain leather seats with 10/6 way electric adjustment and heating for driver and passenger. The soft grain stitched instrument panel and Gloss Rich Oak veneer complete the luxurious look, while assertive 18 inch Vela alloy wheels further enhance the dynamic exterior. The rear parking aid and Touch-screen visual indicator make slipping into tight spaces easy, while distractions at night are reduced by autodimming rear view mirrors. The Meridian™ 380W Sound System, with Digital Audio Broadcasting (DAB) radio receiver and Front Media Interface with USB and iPod® connectivity, lets you listen to your favourite music in rich detail. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    25. 25. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    26. 26. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    27. 27. http://www.datasciencecentral.com/forum/topics/the-3vs-that-define-bigdata www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    28. 28. GET B PUT C PUT B B Application Application C Application Application Key Partition Key Partition Key Partition C Key Partition B B www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    29. 29. public static void main( String[] args ) { CacheManager cacheManager = Caching.getCachingProvider().getCacheManager(); MutableConfiguration<String, String> config = new MutableConfiguration<String, String>(); cacheManager.configureCache("C2B2",config); Cache cache = cacheManager.getCache("C2B2"); cache.put("Key", "Value"); System.out.println(cache.get("Key")); } http://blog.c2b2.co.uk/2013/08/jsr107-getting-started.html www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    30. 30. Consistent Hashing Node 1 Hash Key Hash Node 3 Hash Key Space Hash Ring Node 4 Hash www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting Node 2 Hash The Leading Independent Middleware Experts
    31. 31. Key Partitioning • Keys Assigned Partition via Hash • Nodes Own a Partition • Number of Partitions Fixed • Number of Nodes isn’t www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting Partition Partition Partition Partition Partition Partition Partition The Leading Independent Middleware Experts
    32. 32. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    33. 33. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    34. 34. PUT B B Application Key Partition B Application Application Application Key Partition Key Partition Key NODE Partition www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting CRASH !!! The Leading Independent Middleware Experts
    35. 35. Application Application Application Application Application Application Application Cache Cache Cache Cache Cache Cache Cache Application Application Application Application Application Application Application Cache Cache Cache Cache Cache Cache Cache Application Application Application Application Application Application Application Cache Cache Cache Cache Cache Cache Cache 21 Amazon m2.xLargeMemory Instance with 17Gb RAM 3 Nodes Per Instance with 4Gb 64bit JVM Heap + 5 Gb OS 63 Cluster Nodes 252 Gb JVM Heap Available Approx 125Gb Data in the Grid when taking into account duplicates 42 vCPUs Approx $3633 per month www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    36. 36. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    37. 37. Application Application Application Application Key Partition Code Key Partition Key Partition Key partition www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    38. 38. 1Gb Ethernet : 25 – 30MB/s 10Gb Ethernet : 250 – 350MB/s Infiniband : 6GB/s (maybe) www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    39. 39. Application Application Application Application Cache Cache Cache Cache Code www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    40. 40. Class Size of code to Serialize is a few Kb www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    41. 41. // Invoking a Map Object oResult = map.invoke(key, agent); // Invoke on a subset of the cache NamedCache map = CacheFactory.getCache("trades"); Filter filter = new AndFilter(new EqualsFilter("getTrader", traderid), new EqualsFilter("getStatus", Status.OPEN)); Map mapResults = map.invokeAll(filter, agent); // The Agent Interface public interface EntryProcessor extends Serializable { public Object process(Entry entry); Map processAll(Set setEntries); } www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    42. 42. <T> T invoke(K key, EntryProcessor<K, V, T> entryProcessor, Object... arguments) throws EntryProcessorException; <T> Map<K, T> invokeAll(Set<? extends K> keys, EntryProcessor<K, V, T> entryProcessor, Object... arguments); T process(MutableEntry<K, V> entry, Object... arguments) throws EntryProcessorException; } www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    43. 43. • Financial Risk Calculation – Can I book this Order • Bet Placement – Can I place this Bet Application Keys Application Keys Application Keys • Hotel Availability Search – What hotels are available • Web Translation – Gather Translated Text www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    44. 44. • Consumer Trend Analysis – Who orders what when • Route Optimisation – Delivery Trucks Application Keys Application Keys Application Keys • Social Graph Search – Patterns in social media graphs • Fraud Detection – Transaction analysis www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    45. 45. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    46. 46. public interface CacheEntryListener<K, V> extends EventListener { } public interface CacheEntryUpdatedListener<K, V> extends CacheEntryListener<K, V> { /** * Called after one or more entries have been updated. * * @param events The entries just updated. * @throws CacheEntryListenerException if there is problem executing the listener */ void onUpdated(Iterable<CacheEntryEvent<? extends K, ? extends V>> events) throws CacheEntryListenerException; } www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    47. 47. • Product Recommendations – Related products • Alerting – Truck has Stopped! • Financial Position Calc – Check regs during booking • Nudge Purchasing Application Keys Application Application Keys www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting Keys – 5 people are looking at this hotel The Leading Independent Middleware Experts
    48. 48. http://blog.c2b2.co.uk/2012/06/infinispan-event-push-to-tomcat.html http://demo.c2b2.co.uk:8080/infinispan/ www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    49. 49. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    50. 50. Coherence GlassFish WebSocket http://demo.c2b2.co.uk:7080 or Full URL http://demo.c2b2.co.uk:7080/CleanStockTicker/stockticker.jsp http://blog.c2b2.co.uk/2012/10/java-one-2012-slides-and-code.html www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    51. 51. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    52. 52. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    53. 53. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    54. 54. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    55. 55. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    56. 56. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    57. 57. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts
    58. 58. www.c2b2.co.uk blog.c2b2.co.uk @c2b2consulting The Leading Independent Middleware Experts

    ×