Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
While Node.js is the hot new kid on the block, evented libraries like EventMachine for Ruby and Twisted for Python have existed for a long time. When does it make sense to use one over the other? What are the advantages and disadvantages to using node over ruby? In this talk, you will learn how to get the same power of concurrency enjoyed by Node.js while continuing to write in the language you know and love. Topics covered will include pubsub with redis or faye, building evented rack applications, and running evented applications alongside existing Rails apps.
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In the video titled **Evented Ruby vs Node.js**, Jerry Cheung presents a detailed comparison of evented programming in Ruby versus Node.js, shedding light on performance optimizations and language capabilities. The talk emphasizes the relevance of concurrency in modern web applications and how Ruby developers can leverage evented libraries to achieve similar performance benefits that Node.js offers. **Key Points Discussed:** - **Introduction to Evented Programming**: Cheung introduces the concept of evented programming, which is essential for handling real-time web applications efficiently. He explains the event-driven, non-blocking IO model that Node.js uses and how it contrasts with Ruby's traditional handling of IO tasks. - **Blocking vs Non-Blocking IO**: The speaker elaborates on the distinction between blocking and non-blocking IO, illustrating its significance with the analogy of a CPU waiting for slower components. This model shows how using a reactor helps avoid unnecessary waiting times during database calls or network requests. - **Comparative Example**: Utilizing a tweeted example of processing requests in Ruby and Node.js, Cheung demonstrates how Node.js can handle multiple requests effectively by registering callbacks, enhancing throughput without consuming as much memory compared to spinning up multiple Ruby processes. - **EventMachine in Ruby**: He discusses the EventMachine library for Ruby, which allows developers to implement the reactor pattern. The talk covers how easy it is to integrate evented IO into existing Rails applications using EventMachine or Rack Fiber Pool, without significant code alteration. - **Practical Applications**: Throughout the talk, Cheung encourages developers to put the principles of evented programming into practice, offering practical insights on how to modify existing code to take advantage of Ruby’s capabilities without falling into the trap of callback hell. - **Latency and Efficiency**: The speaker stresses that while evented programming can enhance concurrency, developers should first aim to optimize response latency for performance benefits. **Conclusions/Takeaways**: - Ruby can effectively handle evented programming, presenting a viable option against Node.js for developers who favor Ruby's syntactic clarity. - Libraries such as Faraday and limited use of fibers can enhance Ruby applications' performance without sacrificing the language's elegance. - Evented programming requires awareness of IO operations, and it's vital to separate domain logic from IO processing to maintain code readability and maintainability.
Suggest modifications
Cancel