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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Theo Hultberg
August 17, 2012
Programming
720
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
Transcript
47 slides
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
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
98
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
240
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
190
Shortcuts Around the Mistakes I've Made Scaling MongoDB
iconara
4
180
Other Decks in Programming
See All in Programming
The Cost of the DOM
ypresto
2
170
どうしても Eloquent でリポジトリパターンをやりたいんだ #phpcon_niigata / phpcon-niigata-2026
shogogg
0
670
How SRE Grew Out of Server-Side Work and Became the Team's Own / サーバサイドから始まったSREを チームに渡すまで
maaaato
0
190
Materialが消えた日 〜真っ白なFlutterキャンバスにRenderObjectで絵を描く〜
umigishiaoi
0
170
Kotlin Fest 2026: Kotlin コンパイラに Contribute してみよう! - Kotlin/Wasm で深い再帰を書けるようにした話
ternbusty
1
420
はじめてのKubernetesコントリビューション
nasa9084
0
320
Agentic AI with the Power of Jakarta EE
ivargrimstad
0
180
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
360
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
420
テストだけで見つかる? Rubyでつくるメソッド発掘器
izawa
0
160
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
140
地方こそサーバーレス — 10年続けた、顔が見えるチームで確かな基盤を / Serverless Matters Most in Regional Areas — 10 Years of Building Reliable Foundations with Close-Knit Teams
seike460
PRO
2
510
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
331
22k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
500
Code Reviewing Like a Champion
maltzj
529
40k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
310
Building a Scalable Design System with Sketch
lauravandoore
464
34k
How to build a perfect <img>
jonoalderson
1
6.3k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.7k
Un-Boring Meetings
codingconduct
0
510
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.6k