4. Scalable Server-Side Code with JavaScript
Node Up and Running
Tom Hughes-Croucher
http://ofps.oreilly.com/titles/9781449398583/
http://shop.oreilly.com/product/0636920015956.do
37. {"created_at":"Mon May 21 19:06:18 +0000 2012","id":204649335533735936,"id_str":"204649335533735936","text":"discussing the viability of a hosted IRC logging service with @mwbrooks. anyone have
thoughts on this?","source":"u003ca href="http://itunes.apple.com/us/app/twitter/id409789998?mt=12" rel="nofollow"u003eTwitter for Macu003c/a
u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":
5447362,"id_str":"5447362","name":"Brock Whitten","screen_name":"sintaxi","location":"iPhone: 49.281845,-123.108002","description":"Co-creator of phonegap. Engineer at Joyent. Favorite things
include cinema, beer, beach, board games, javascript, ruby, and programs that are fast.","url":"http://sintaxi.com","protected":false,"followers_count":775,"friends_count":139,"listed_count":
86,"created_at":"Mon Apr 23 23:30:49 +0000 2007","favourites_count":44,"utc_offset":-28800,"time_zone":"Pacific Time (US & Canada)","geo_enabled":true,"verified":false,"statuses_count":
2736,"lang":"en","contributors_enabled":false,"is_translator":false,"profile_background_color":"1A1B1F","profile_background_image_url":"http://a0.twimg.com/images/themes/theme9/
bg.gif","profile_background_image_url_https":"https://si0.twimg.com/images/themes/theme9/bg.gif","profile_background_tile":false,"profile_image_url":"http://a0.twimg.com/profile_images
/2036233722/Photo_19_normal.jpeg","profile_image_url_https":"https://si0.twimg.com/profile_images/2036233722/
Photo_19_normal.jpeg","profile_link_color":"09BBF6","profile_sidebar_border_color":"BDBDBD","profile_sidebar_fill_color":"E0E0E0","profile_text_color":"333333","profile_use_background_image":tru
e,"show_all_inline_media":false,"default_profile":false,"default_profile_image":false,"following":true,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null
,"contributors":null,"retweet_count":0,"entities":{"hashtags":[],"urls":[],"user_mentions":[{"screen_name":"mwbrooks","name":"Michael Brooks","id":14280268,"id_str":"14280268","indices":
[62,71]}]},"favorited":false,"retweeted":false},
38. HTML vs. JSON
• Larger size (KB) • Small size
• Less browser processing • More browser intensive
• e.g. innerHTML insert • e.g. templating
• Requires more server • Requires less server
work work
39. Computer vs. Mobile
• More processing power • Less processing power
• Probably more/faster • Probably less/slower
bandwidth bandwidth
JSON Probably HTML
Maybe JSON
iPad wifi vs. iPhone 3 on 3G