Server Side Basics

702 views

Published on

Slides from the PDX Web & Design Meetup, 3/15/2011

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
702
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Server Side Basics

    1. 1. SERVER SIDE BASICS Keith Swallow PDX Web & Design Meetup
    2. 2. TONIGHT• DNS: What Does 72.26.203.99 Mean?• HTTP: Its Just Text!• MVC: The Way of Web Apps• Recipes: Login and Email• Scaling: More, Smaller, Faster
    3. 3. DNSWhat Do Those Numbers Mean?
    4. 4. DOMAIN NAMING SERVICE• Computers are bad with names, prefer numbers• People are bad with numbers, prefer names• DNS bridges the gap
    5. 5. • You type http://xkcd.com in a browser• Your computer asks its local DNS server where xkcd.com is• That DNS server asks an authoritative server• Then relays the IP address (72.26.203.99)
    6. 6. DOMAIN NAMING SERVICE where is xkcd.com?your computer DNS server
    7. 7. DOMAIN NAMING SERVICE where is xkcd.com? where is xkcd.com?your computer DNS server authoritative DNS server
    8. 8. DOMAIN NAMING SERVICE where is xkcd.com? 72.26.203.99your computer DNS server authoritative DNS server
    9. 9. DOMAIN NAMING SERVICE 72.26.203.99 72.26.203.99your computer DNS server authoritative DNS server
    10. 10. DOMAIN NAMING SERVICE 72.26.203.99 72.26.203.99your computer DNS server authoritative DNS server xkcd.com 72.26.203.99
    11. 11. HTTPIts Just Text!
    12. 12. HYPER TEXT TRANSFER PROTOCOL• Request • Ask for data• Response • Read response headers • Act on response body• Repeat
    13. 13. HTTP VERBS• GET• POST• PUT• DELETE
    14. 14. HTTP REQUESTHost: xkcd.comUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/ 20100401 Firefox/3.6.3Accept: text/html,application/xhtml+xml,application/xml;Accept-Language: en-us,en;Accept-Encoding: gzip,deflateAccept-Charset: ISO-8859-1,utf-8;Keep-Alive: 115
    15. 15. HTTP RESPONSE HEADERSVary: Accept-EncodingLast-Modified: Mon, 21 Feb 2011 05:00:08 GMTEtag: "2060469139"Content-Type: text/htmlAccept-Ranges: bytesDate: Tue, 22 Feb 2011 18:28:44 GMTServer: lighttpd/1.4.19Content-Length: 2799
    16. 16. HTTP RESPONSE BODY<?xml version="1.0" encoding="utf-8" ?><?xml-stylesheet href="http://imgs.xkcd.com/s/c40a9f8.css" type="text/css" media="screen" ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <title>xkcd: Computer Problems</title> <link rel="stylesheet" type="text/css" href="http://imgs.xkcd.com/s/c40a9f8.css" media="screen" title="Default" /><link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="/atom.xml" /> <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="/rss.xml" />
    17. 17. HTTP RESPONSE BODY
    18. 18. MVCThe Way of Web Apps
    19. 19. MODEL-VIEW-CONTROLLER• Controller • Handles the request and sends it to the correct model(s)• Model • Business logic and abstract representation of domain entities• View • Display of information contained in models
    20. 20. REQUEST FLOW Browser Controller View Model
    21. 21. RAILS MVC & RECIPES• Logon• Email
    22. 22. SCALINGMore, Smaller, Faster
    23. 23. SCALING• Horizontal Scaling (More) • Throw more hardware at the problem• Vertical Scaling (Smaller) • Cut the problem into smaller chunks• Caching (Faster) • Increase response speed, reduce load
    24. 24. HORIZONTAL SCALING• Add more hardware to deliver the same content your computer xkcd.com web
    25. 25. HORIZONTAL SCALING• Add more hardware to deliver the same content your computer xkcd.com web images
    26. 26. HORIZONTAL SCALING• Add more hardware to deliver the same content your computer xkcd.com web images database
    27. 27. HORIZONTAL SCALING• Add more hardware to deliver the same content your computer xkcd.com web images database
    28. 28. HORIZONTAL SCALING• Add more hardware to deliver the same content your computer xkcd.com web images database
    29. 29. VERTICAL SCALING xkcd.com web images database your computer• Break the system into specialized parts
    30. 30. VERTICAL SCALING xkcd.com web images your computer database• Break the system into specialized parts
    31. 31. VERTICAL SCALING xkcd.com web images your computer• Break the system into specialized parts database
    32. 32. VERTICAL SCALING xkcd.com cache your computer web• Respond quickly to the images database request
    33. 33. QUESTIONS?Speak now or forever hold your peace
    34. 34. THANK YOU! Keith Swallow keithcelt.com twitter.com/keithcelt keithcelt@gmail.com

    ×