Vladimir Dementyev - Untangling cables and demystifying twisted transistors - Rails World 2023

"Understand connection and execution context, master Action Cable's limitations, and learn solutions for high traffic and excessive resource usage with server-side and client-side code designed for exceptions."

Key takeaways
  • Connection context and execution context are different, and connection context is not an execution boundary.
  • Action Cable is missing session identifiers and message identifiers, which can lead to issues with reconnecting and managing subscriptions.
  • Recap: server-side and client-side code should be designed to handle exceptions and errors properly.
  • Introduction to conceptual compression and provenience concept in Rails.
  • Action Cable lacks easy mechanisms to handle exceptions and connection closures.
  • Using a custom server and Realm for Action Cable can help with performance issues.
  • Comparing and contrasting concurrency models (e.g., Occasional Alice, Cohort-based approach).
  • Recap of main problem: constant flow of subscriptions and unsubscriptions, without any concept of a session or a message identifier.
  • Solution: Realm; limitations and potential use cases for Realm.
  • Conclusion: understanding connection and execution context, implementing Realm, handling exceptions.
  • Recap of the importance of TCP and network-level connection for WebSocket communication.
  • Solution: using a monitor to handle connection closures.
  • Importance of lifelong connections and connection context.
  • Recap: server-side and client-side code should be designed to handle exceptions and errors properly.
  • Recap of main problem: high traffic and excessive resource usage because of frequent subscriptions and unsubscriptions.
  • Solution: use Rebels; other potential solutions like AnyCable.
  • Recap: main problem: Action Cable does not have easy mechanisms to handle exceptions and connection closures.
  • Solution: implement a monitor.
  • Recap: importance of understanding connection and execution context.
  • Recap of importance of lifecycle callbacks, incoming commands, and outgoing messages in managing subscriptions.
  • Recap of the importance of a monitor in handling connection closures.
  • Recap: server-side and client-side code should be designed to handle exceptions and errors properly.
  • Introduction to conceptual compression and provenience concept in Rails.
  • Recap of main problem: constant flow of subscriptions and unsubscriptions, without any concept of a session or a message identifier.
  • Solution: Revenge of the Sith; limitations and potential use cases for Revenge of the Sith.
  • Conclusion: understanding connection and execution context, implementing Revenge of the Sith, handling exceptions.