php - balancing Server side and Client side code on a large website -


Let's say I'm programming Facebook (which I'm not) or any other site contains heavy traffic.

Our default layout is:

  1. All CSS is in external file
  2. 99% of JS is in external file
  3. The back bone of the websites is generated by a PHP / MySQL backend.
  4. JS Functions that usually change, produce the DOM of those parts.
  5. Our server has an in-display API that returns JSON objects that are fed to our DOM Builders (JS Function), which takes a JSON object, a list of friends, then all HTML To display a list of used friends, or events etc.

Question

  1. Is this fair?
  2. Is it normal practice that I mentioned in the DM? Are JS Functions dedicated to the creation of?
  3. Is this scalable? JS is very slow? (BTW, we use JQuery almost entirely)

I know that it significantly reduces the bandwidth and server load, because the server is no longer through the list of friends Is running (of which it has been inquired for via MySQL) and instead of generating all the HTML, but creating a query and returning a small JSON object that I feel okay, but I'm a 2 / 3rd / 4th / ... should get feedback

very much thank you Adad!

Let me know if there is a lack of any important information.

I think your layout is very good, but I still recommend you to read .

I think the three most important things Facebook does to scale it on:

Ol>

  • Caching => It is really important that you should remember that disk IO is slow compared to memory (disk 5 ms / memory 40-80 cc according to me). There are almost all active data in memory in Facebook that they have more than 5TB in their memory
  • HIPHOP =>
  • Offline processing => Use a message queue for example, for just a few names.
  • Some other interesting links:


    Comments

    Popular posts from this blog

    c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

    Calling GetGUIThreadInfo from Outlook VBA -

    Obfuscating Python code? -