Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Nicholatian

Is it that big of a deal in performance to involve ExpressJS in a clientside-rendering web app?

Recommended Posts

Posted · Original PosterOP

So I’m developing a codebase for a website/webapp that strictly uses client-side rendering to accomplish all of its tasks. My HTTP backbone is Nginx in a Linux container on dedicated hardware, and I’m faced with a delimma that may impact performance substantially. Do I:

 

  1. Make the website entirely client-side and maximize my server-side resources using Nginx’s hella powerful static serving capabilities, and fetch all dynamic data from a JSON-serving database liasion; or
  2. Use Nginx as a proxy to an ExpressJS app that allows better control over dynamically allocated URLs

 

If I go totally static and forego any server-side niceties, I’d have to resort to using GET arguments to create dynamic URLs, such as profiles or other user-created content that I need to be URL-based; this is a fair but uglier than I’d like it to be. On the other hand, if I put an ExpressJS app in between those clientside-rendering pages and Nginx, I can create SEO-friendly (and nice-looking) URLs easily, and easily avoid ugly file extensions in the URLs without resorting to URI rewriting with Nginx.

 

I guess what it boils down to is: Would the performance impact of a content-static ExpressJS server be that big of a deal? Do you think the time and resources given up to allow this are relatively closer to a static Nginx site, or is the impact closer to a fully dynamic ExpressJS app using Jade/SASS or something?

 

I would also like to hear from @Cat :^) about this if he has time. I understand that this particular sect of development may not be his forté, but I know he’s a web developer and would have some clue as to what I’m talking about to help me evaluate this. I would highly value his/her feedback.


My GitHub — The Injustice of Complexity in Computing — Abusive Relationships With Programming Languages

The only horror is that horror is no longer possible.

Link to post
Share on other sites
On 3/21/2016 at 1:54 PM, AlexTheRose said:

So I’m developing a codebase for a website/webapp that strictly uses client-side rendering to accomplish all of its tasks. My HTTP backbone is Nginx in a Linux container on dedicated hardware, and I’m faced with a delimma that may impact performance substantially. Do I:

 

  1. Make the website entirely client-side and maximize my server-side resources using Nginx’s hella powerful static serving capabilities, and fetch all dynamic data from a JSON-serving database liasion; or
  2. Use Nginx as a proxy to an ExpressJS app that allows better control over dynamically allocated URLs

 

If I go totally static and forego any server-side niceties, I’d have to resort to using GET arguments to create dynamic URLs, such as profiles or other user-created content that I need to be URL-based; this is a fair but uglier than I’d like it to be. On the other hand, if I put an ExpressJS app in between those clientside-rendering pages and Nginx, I can create SEO-friendly (and nice-looking) URLs easily, and easily avoid ugly file extensions in the URLs without resorting to URI rewriting with Nginx.

 

I guess what it boils down to is: Would the performance impact of a content-static ExpressJS server be that big of a deal? Do you think the time and resources given up to allow this are relatively closer to a static Nginx site, or is the impact closer to a fully dynamic ExpressJS app using Jade/SASS or something?

 

I would also like to hear from @Cat :^) about this if he has time. I understand that this particular sect of development may not be his forté, but I know he’s a web developer and would have some clue as to what I’m talking about to help me evaluate this. I would highly value his/her feedback.

From what I understand, ExpressJS includes a web server, so I don't quite understand why you would need Nginx at all. But I'm really not good at back end stuff, this is more of a question for @colonel_mortis

Link to post
Share on other sites

Although I haven't used ExpressJS personally, I doubt that it would have as much of a performance impact as you're expecting. The best thing to do though would be to test it - write a simple handler in ExpressJS and run some performance tests, then do the same thing using raw nigix. Assuming ExpressJS is properly optimised, I doubt that you'd see much additional latency at all.


HTTP/2 203

Link to post
Share on other sites

I'd go for writing backend too, but that can be a bit bias... just read along.

I'm a backend developer, I just find all the front end things way more difficult to deal with than they are on the backend. I also think that it would be way more difficult to write. I don't know how you would like to go about database access there, if you want to have profiles but without writing any backend.

Another thing is JavaScript... I am one of those people who don't really like it. I know what I'm talking about, this is so far the language I programmed most in. If I touch front end (which is rare), I use CoffeeScript instead.

And it's not just for front end, I recently switched from JS to Ruby on the back end, and my experience is much better. I found JS on backend to be very unintuitive and messy. For example I shrinked one function from 20 lines of unreadable JS to 9 lines of simple and readable Ruby. Everything is much quicker and more comfortable to use. The only disadvantages of the move are globally-installed dependencies (but I think there is a way to do local ones, no?) and generally bad documentation.

Also, there is no full-fledged framework for JS like Rails that I liked.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×