Scalability




CS174

Chris Pollett

Nov. 18, 2013

Outline

Scaling a Web-site

Example Web-site Architecture

Organization of a website show squids, http servers, memcached server, databases.

Remarks on Architecture

Content Delivery Networks

Object Relational Mappings

Quiz

Which of the following statements is true?

  1. We said you should use the HTTP X-Frame-Options header to prevent XSS attacks.
  2. PHP functions beginning with mb_, such as mb_substr, provide support for multi-byte character encodings like UTF-8.
  3. gettext is used to download code from a remote website.

Memcached

Running memcached

Demo of connecting to memcached as a human - set

Demo of connecting to memcached as a human - get

Some Remarks on Memcached

Using memcached in PHP

Example Memcache Test

<html>
<head><title>Memcache Test</title></head>
<body>
<h1>Test</h1>
<?php
  $memcache = new Memcache();
  $memcache->addServer("localhost", 11211, true, 1, 1, 5);
  $memcache->set("bob", "value", null, 60);
  echo "<p>".$memcache->get("bob")."</p>";
?>
</body>
</html>