Is Action Cable the same thing as Faye?
Asked Answered
E

1

8

Implementing Web Sockets in my app I've become confused which gem is better. I found plenty of different opportunities, however, some are hard to distinct.

Finally, I've chosen Action Cable (a Rails 5 native part) and Faye (appeared earlier and became very popular).

But now I'm stuck - is Action Cable the same thing as Faye? Which are differences (if there's any)?

Eldoria answered 21/2, 2017 at 10:53 Comment(5)
It is easier to vote down than answer, right?Eldoria
I think the down votes was because the question is a little bit off-topicScar
I think that's because people love questions like "What's the command for running a migration?" My question wasn't off-topic, however, it looked like at glance. At least I didn't want to be off-topic. I just wanted to get what's the difference in further programming before integrating any of these gems.Eldoria
Why it is off-topic??Busty
@FelipeMaion People think I asked: "Which gem is better?". Nevertheless, it is a question about the difference between these gems.Eldoria
S
10

From the Faye website: Faye is a publish-subscribe messaging system based on the Bayeux protocol. It provides message servers for Node.js and Ruby, and clients for use on the server and in all major web browsers.

From the ActionCable readme: Action Cable seamlessly integrates WebSockets with the rest of your Rails application. It allows for real-time features to be written in Ruby in the same style and form as the rest of your Rails application, while still being performant and scalable. It's a full-stack offering that provides both a client-side JavaScript framework and a server-side Ruby framework. You have access to your full domain model written with Active Record or your ORM of choice.


Short answer is YES, both are pub/sub messaging system.

Long answer is NO, because faye is a low-level tool and ActionCable uses faye (look here), al least some components.

But you always can get the same results using (maybe) different efforts building an application using faye or ActionCable. The big difference is Faye works as a rack-based component instead of rails-based component.

Scar answered 21/2, 2017 at 15:54 Comment(1)
Future readers might want to know that ActionCable performs TERRIBLY. I ran into my own problems with it only after moving my work to a production environment, and it's literally so bad that it's unusable if you expect high traffic. As example, this post here describes a benchmark test involving 20,000 idle clients. ActionCable uses 3.5GB of memory, compared to other solutions, which are < 900MB medium.com/@leshchuk/from-action-to-any-1e8d863dd4cfTrellas

© 2022 - 2024 — McMap. All rights reserved.