Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Concurrency and Distributed Systems in JRuby
Search
Theo Hultberg
August 17, 2012
Programming
3
670
Concurrency and Distributed Systems in JRuby
Presentation given av JRubyConf EU/Eurucamp 2012
Theo Hultberg
August 17, 2012
Tweet
Share
More Decks by Theo Hultberg
See All by Theo Hultberg
Datalakes at AWS Summit Stockholm 2018
iconara
0
96
Building a CQL driver
iconara
0
61
Chasing the Elephant
iconara
0
93
Learning to Build Distributed Systems the Hard Way
iconara
1
150
Learning to Build Distributed Systems the Hard Way
iconara
2
220
Learning to Build Distributed Systems the Hard Way
iconara
3
5.1k
A Guide to the Post Relational Revolution
iconara
4
5.4k
Standing on the Shoulders of Giants with JRuby
iconara
4
160
Shortcuts Around the Mistakes I've Made Scaling MongoDB
iconara
4
170
Other Decks in Programming
See All in Programming
「文字列→日付」の落とし穴 〜Ruby Date.parseの意外な挙動〜
sg4k0
0
350
しっかり学ぶ java.lang.*
nagise
1
470
20 years of Symfony, what's next?
fabpot
2
300
TVerのWeb内製化 - 開発スピードと品質を両立させるまでの道のり
techtver
PRO
3
1.3k
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
4
250
手軽に積ん読を増やすには?/読みたい本と付き合うには?
o0h
PRO
1
140
『実践MLOps』から学ぶ DevOps for ML
nsakki55
2
540
これだけで丸わかり!LangChain v1.0 アップデートまとめ
os1ma
6
1.2k
Google Antigravity and Vibe Coding: Agentic Development Guide
mickey_kubo
2
130
MAP, Jigsaw, Code Golf 振り返り会 by 関東Kaggler会|Jigsaw 15th Solution
hasibirok0
0
200
How Software Deployment tools have changed in the past 20 years
geshan
0
27k
無秩序からの脱却 / Emergence from chaos
nrslib
2
11k
Featured
See All Featured
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Docker and Python
trallard
46
3.7k
Building an army of robots
kneath
306
46k
Into the Great Unknown - MozCon
thekraken
40
2.2k
Speed Design
sergeychernyshev
33
1.3k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
We Have a Design System, Now What?
morganepeng
54
7.9k
The Cost Of JavaScript in 2023
addyosmani
55
9.3k
Automating Front-end Workflow
addyosmani
1371
200k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
Leading Effective Engineering Teams in the AI Era
addyosmani
8
1.2k
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