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.
2. SAFE HARBOR
This talk may contain nonsense.
www.c2b2.co.uk blog.c2b2.co.uk
@c2b2consulting
The Leading Independent Middleware Experts
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
10. Can you add more?
CPU
Disk
Memory
Bandwidth
www.c2b2.co.uk blog.c2b2.co.uk
@c2b2consulting
The Leading Independent Middleware Experts
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
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
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
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. DDR3 1600 : 12.8GB/s
www.c2b2.co.uk blog.c2b2.co.uk
@c2b2consulting
The Leading Independent Middleware Experts
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
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
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
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. 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. 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. 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
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. • 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
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. • 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
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
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!