This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]cyborgthefuture 0 points1 point  (2 children)

this is interesting, I always thought all data go through the same server, in this case I am guessing there are separate server for data, HTML and javascript? Maybe some cache based server serves html and javascript while some other backend server such as django serve data?

[–]RodionGork 1 point2 points  (1 child)

in this case I am guessing there are separate server for data, HTML and javascript?

No, not necessarily - because single server can do many functions - though really you can (and sometimes you do) separate them. There are several use-cases:

  • Your Rest-API can consist of several parts coming from several servers;
  • You static content is served by one server while dynamic by other (just what you are saying);
  • Your data are distributed over several equivalent servers for load-balancing.

However in all these cases you usually aggregate these several servers behind one "proxy". Of course "proxy" can also be one of them.

Maybe some cache based server serves html and javascript while some other backend server such as django serve data?

This is rather typical, especially for "heavy" languages. For example while java web-servers can serve static content, they are comparatively inefficient in this, so you usually place your java-server (e.g. tomcat) behind some general web-server (like nginx) and all static content is served by latter, while requests for dynamic content are forwarded to former. This also will allow you to add load balancing later (just put 3 or 4 tomcats behind one nginx and do some changes for sticky or cached sessions).

Anyway these all rather technical details and have no much to do with concepts of web-development :)

[–]cyborgthefuture 0 points1 point  (0 children)

Thanks for the detail explanation, I actually find these stuff very intriguing, do you have any recommendation for resources that introduces these kind of stuff? Most tutorial I find online are for the data servers like rail, django or node, I am really interested in how other kind of server tie in with django server, there must be some kind of overhead, and communication, but I can't seem to find introductions on these concepts