Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Concurrency and Distributed Systems in JRuby
Search
Theo Hultberg
August 17, 2012
Programming
710
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Concurrency and Distributed Systems in JRuby
Presentation given av JRubyConf EU/Eurucamp 2012
Theo Hultberg
August 17, 2012
More Decks by Theo Hultberg
See All by Theo Hultberg
Datalakes at AWS Summit Stockholm 2018
iconara
0
110
Building a CQL driver
iconara
0
91
Chasing the Elephant
iconara
0
110
Learning to Build Distributed Systems the Hard Way
iconara
1
170
Learning to Build Distributed Systems the Hard Way
iconara
2
230
Learning to Build Distributed Systems the Hard Way
iconara
3
5.2k
A Guide to the Post Relational Revolution
iconara
4
5.4k
Standing on the Shoulders of Giants with JRuby
iconara
4
180
Shortcuts Around the Mistakes I've Made Scaling MongoDB
iconara
4
180
Other Decks in Programming
See All in Programming
조합이폭발하는디자인시스템이걸눈으로도테스트하라고요
giljongyu
0
620
Inertia Rails: The One-Person Framework with React & Friends
skryukov
0
170
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
380
R8 の設定見直しでアプリサイズ削減
andpad
0
230
パスワード再設定メールのURLについて知っておこう
uyuki234
0
200
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
1.2k
エージェントを使い続けるためのメタワーク / Meta-work for keeping using the agent
rkaga
6
2k
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
3
610
TanStack Vue Query と Pinia Colada から学ぶ非同期状態の型設計
aoshi
0
350
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
1.1k
AI-Powered Domain-Driven Design
ziobrando
0
350
AmebaブログはKMPから卒業します
kmars0605
0
290
Featured
See All Featured
Building the Perfect Custom Keyboard
takai
2
920
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
560
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
Six Lessons from altMBA
skipperchong
29
4.5k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
280
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Deep Space Network (abreviated)
tonyrice
0
390
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
470
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Transcript
CONCURRENCY AND DISTRIBUTED SYSTEMS IN JRUBY @iconara
speakerdeck.com/u/iconara (real time!)
Theo / @iconara
Chief Architect at
big data with Ruby since 2009
MAKING THIS
INTO THIS
big data with Ruby since 2009
APRIL 2011 stuck
MAY 2011 let’s try JRuby
JUNE 2011 wrapping Java libraries for fun and for profit
HOTBUNNIES natural Ruby API for RabbitMQ
JULY 2011 threads are better than processes
JRUBY
JRUBY
J.U.C (java.util.concurrent)
SHORTCUT Java Concurrency in Practice
EXECUTORS configurable thread pools, a better abstraction than using Thread
directly
thread_pool = Executors.new_fixed_thread_pool(16) all_the_things.each do |thing| thread_pool.submit do crunch_crunch_crunch(thing) end
end
BLOCKING QUEUES easy producer/consumer patterns
J.U.C.ATOMIC optimistic locking primitives, compare-and-swap, thread safe non-blocking counters
MORE AWESOMES ConcurrentHashMap, CountDownLatch, ForkJoinPool, Google Guava, LMAX distruptor
TL; DR use j.u.c and avoid mutable state and you’re
safe, mostly
enough rope THREADS
AUGUST 2011 threads are a mess, let’s try actors
ACTORS a higher level abstraction of concurrency
AKKA concurrency library for Scala, famous actor implementation
MIKKA Akka wrapper for JRuby
DO ALL THE THINGS Programming Concurrency on the JVM
AUGUST 2011 async systems with no back pressure mechanism will
die of memory starvation
STATE AGGREGATION INPUT PERSISTENCE OUTPUT TIMER
STATE AGGREGATION INPUT PERSISTENCE OUTPUT TIMER !
AUGUST 2011 actors are cool, but not really worth it
when all the arrows in your flow chart point in the same direction
DIVIDE DIVIDE DIVIDE run multiple independent, synchronous workers, tune to
the number of CPUs & IO wait
SEPTEMBER 2011 blocking all the way down, back pressure all
the way up
AUGUST 2011 (short rant about MongoDB’s global write lock)
NEW SHINY TOYS for building new shiny products
CASSANDRA distributed database, mostly magic
CASSANDRA very verbose drivers ColumnFamilyUpdater<String, String> updater = template.createUpdater("a key");
updater.setString("domain", "www.datastax.com"); updater.setLong("time", System.currentTimeMillis()); try { template.update(updater); } catch (HectorException e) { // hurgh }
EURYDICE JRuby nails it new_data = {:domain => 'www.datastax.com', :time
=> Time.now.to_i} column_family.update('a key', new_data)
STORM stream processing framework written in Clojure
STORM (it does the arrows, you do the blobs)
REDSTORM Storm for JRuby
DON’T DO THIS AT HOME KIDS! the key to building
concurrent and distributed systems is to separate what you want to do from the concurrent- and distributed-ness, and let someone else take care of that YOUR CODE
JRUBY IS A SLIPPERY SLOPE TO JBOSS let there be
no doubt about it
SCALING IS HARD go to Srdan’s talk tomorrow
KTHXBAI @iconara github.com/iconara architecturalatrocities.com burtcorp.com