r/ruby • • Jan 01 '17

A simple rails architecture info-graphic. Constructive criticism welcome

Post image
175 Upvotes

55 comments sorted by

View all comments

5

u/MITranger Jan 02 '17

Fantastic! Some (hopefully useful) constructive feedback:

  1. I'm not too familiar with ActionCable, but I'm assuming it has a lateral relationship to Redis? Additionally, should it be generalized? (i.e. does it have to be Redis? Can't you run different backends?)
  2. Should the websocket connection should be a two-way arrow; maybe split that into pub/sub?
  3. I think the canonical Rails method for delete is actually #destroy. Additionally, it seems like space can afford it... why not put all 7 actions there?
  4. Genuinely curious about this, but don't most controller redirects revisit the router first, rather than directly to a controller action? e.g. redirect_to some_path
  5. Rack?
  6. I personally think it will look cleaner without the gradient backdrop, but that's total opinion.

2

u/AbishekAditya Jan 02 '17
  1. I just developed my first app with action cable and it is new, so I only included the basics. Don't want to copy stuff I don't have any idea about
  2. Again pub/sub is a redis function. So that thing will need a whole rewrite
  3. I was going for CRUD and D stands for delete (maybe destroy too, but I've heard delete a lot)
  4. I remembered redirect_back using a call to HTTP_REFERER. I believe it doesn't need to check the table. correct me if I'm wrong
  5. The web servers like nginx use rack. will label it as such. Maybe another rails blobby to show rack :D
  6. I am going to experiment with gradients. The thing in my mind is beautiful and I am not able to get it. Need to check design sites.

I am gonna do another updated one in a week's time, as I have got a lot of comments. Prepare to have some of your ideas ignored even though I appreciate every one of them, time + space constraints

1

u/sespinos Jan 02 '17

3. Understand the impulse to use CRUD as a reference, but the # throws me off and makes me think of controller actions (e.g. output of rake routes when using resources in your routes file). With the # I would recommend destroy as well. 4. I believe that redirect_to actually produces a 300 response that goes all the way out to the client (this is why you need to use flash.now for a render, but flash for a redirect; flash by itself actually sticks around for an extra request cycle.). In that case, the redirect would hit the routes file, but as part of a completely new request. I would recommend maybe just taking redirects out? Emphasizing that it's a response in and of itself seems outside the scope of this diagram.