WebFund 2013F Lecture 1: Difference between revisions

From Soma-notes
Line 9: Line 9:
Browser <-talks to->   Server
Browser <-talks to->   Server


[[how?]]
==how?==
http <-- Stream of text or data byte stream from tcp and puts syntax on it
* http <-- Stream of text or data byte stream from tcp and puts syntax on it
tcp <-- turns packets into continuous stream, controls sending, reordering etc
* tcp <-- turns packets into continuous stream, controls sending, reordering etc
ip <--packet based
* ip <--packet based
ethernet/wifi/...
* ethernet/wifi/...


[[now:]]
==now: ==
Browser               <-talks to->                 Server
Browser               <-talks to->                 Server
program               talking to                 program
program               talking to                 program
Line 24: Line 24:
most of data on internet is encoded in http or smtp
most of data on internet is encoded in http or smtp
code that runs inside of browser is known as sandboxed
code that runs inside of browser is known as sandboxed
everything you care about is in the sandbox
* everything you care about is in the sandbox


google tracks and monetizes you
google tracks and monetizes you
''you'' are the product
* ''you'' are the product


[[bandwidth:]] how much can I get at once?
[[bandwidth:]] how much can I get at once?
Line 36: Line 36:




Server (not actually going to learn any of these languages)
==Server== (not actually going to learn any of these languages)
PHP
* PHP
servlets
* servlets
apache
* apache
rails
* rails




[[node.js is javascript]]
==node.js is javascript==
Why? runs pretty fast
* Why? runs pretty fast
chromes v8 javascript engine and stuck on the server
* chromes v8 javascript engine and stuck on the server
[[on browser access the DOM]]
 
browser manipulates the DOM
 
no DOM on server
==on browser access the DOM==
* browser manipulates the DOM
* no DOM on server
learning javascript running on server first THEN on the browser
learning javascript running on server first THEN on the browser
Server puts together an HTML document that it sends to the browser and then using this they talk to each other
Server puts together an HTML document that it sends to the browser and then using this they talk to each other
- can't trust the browser.
* can't trust the browser.
- browser keeps no secrets
* browser keeps no secrets
- any data sent to server has to be appropriately validated
* any data sent to server has to be appropriately validated


Database is persistent data structure for servers
Database is persistent data structure for servers
-relational database
* relational database


callbacks -> asynchronous I/O
callbacks -> asynchronous I/O
- here is some code, do this when ...
* here is some code, do this when ...


processes
processes
threads :  
threads :  
-start new thread
* start new thread
- heavier weight than you want
* heavier weight than you want
- not efficient
* not efficient

Revision as of 21:09, 8 November 2013

Audio from the lecture given on September 9, 2013 is available here.

Notes

September 9 Node

Web Browser <-talks to-> Server

how?

  • http <-- Stream of text or data byte stream from tcp and puts syntax on it
  • tcp <-- turns packets into continuous stream, controls sending, reordering etc
  • ip <--packet based
  • ethernet/wifi/...

now:

Browser <-talks to-> Server program talking to program (embedded in html document that was loaded)

most of data on internet is encoded in http or smtp code that runs inside of browser is known as sandboxed

  • everything you care about is in the sandbox

google tracks and monetizes you

  • you are the product

bandwidth: how much can I get at once? latency: when I make a request, how long does it take for me to get the first bit

gmail has all kinds of code built in to predict what you want and predicts which emails you're going to want to read constantly modelling your behaviour to work well


==Server== (not actually going to learn any of these languages)

  • PHP
  • servlets
  • apache
  • rails


node.js is javascript

  • Why? runs pretty fast
  • chromes v8 javascript engine and stuck on the server


on browser access the DOM

  • browser manipulates the DOM
  • no DOM on server

learning javascript running on server first THEN on the browser Server puts together an HTML document that it sends to the browser and then using this they talk to each other

  • can't trust the browser.
  • browser keeps no secrets
  • any data sent to server has to be appropriately validated

Database is persistent data structure for servers

  • relational database

callbacks -> asynchronous I/O

  • here is some code, do this when ...

processes threads :

  • start new thread
  • heavier weight than you want
  • not efficient