• Save
Barcamp03 Slides
Upcoming SlideShare
Loading in...5
×
 

Barcamp03 Slides

on

  • 467 views

Push Techonology for Real Time Web

Push Techonology for Real Time Web

Statistics

Views

Total Views
467
Views on SlideShare
467
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Barcamp03 Slides Barcamp03 Slides Presentation Transcript

  • Push Technology for Real Time Web by LowerMyBid.com
    • Case study: LowerMyBid.com web site
  • Push Technology for Real Time Web by LowerMyBid.com
    • What are the functionalities of the site:
    • LMB is a penny auction web site where the lowest unique bider is the winner.
  • Push Technology for Real Time Web by LowerMyBid.com
    • What challenges do we have:
    • Each time there is a new bid:
      • Process the bid:
        • Is there a new winner?
        • Update the auction time (typically +15 sec)
        • Update the bidder browser
        • Update as soon as possible all browsers
    • But only those connected to this auction!
  • Push Technology for Real Time Web by LowerMyBid.com
    • What challenges do we have:
    • In the background:
      • Process the bid's accounting:
        • Check if the bidder has enough points to bid
        • Deduct points from bidder account
  • Push Technology for Real Time Web by LowerMyBid.com
    • What challenges do we have:
    • In foreground:
      • Update bidder browser:
        • Show the bidder his new points available
        • Update the bidder auction box
    • No big deal, ajax request / response
  • Push Technology for Real Time Web by LowerMyBid.com
    • What challenges do we have:
    • In foreground:
      • Update all browsers (connected to this auction)
        • Update the timer
        • Update the new winner (or killed)
        • Show that somebody has placed a bid
  • Push Technology for Real Time Web by LowerMyBid.com
    • What challenges do we have:
    • In the background also:
      • Process the auctions management:
        • Has one auction ended?
          • Verify the winner
          • Process the auction closure
          • Show the final winner in all browsers
          • Remove the auction from all browsers after a certain period of time.
          • Show it in the past auctions pannel for all browsers
  • Push Technology for Real Time Web by LowerMyBid.com
    • What challenges do we have:
    • In the background also:
      • Process the auctions management:
        • Is there a new auction to start?
          • Remove it from the future auctions from all browsers
          • Show the new auction in all browsers
          • Start it!
  • Push Technology for Real Time Web by LowerMyBid.com
    • What challenges do we have:
    • In the background also:
      • If an action end with no winners: (winners was killed)
        • Set it to restart
        • Show to all browser that the auction will restart (typically for 2 hours)
        • Restart it in all browsers
  • Push Technology for Real Time Web by LowerMyBid.com
    • The major challenge is to update, as soon as possible, all interested browsers!
  • Push Technology for Real Time Web by LowerMyBid.com
    • The major challenge is to update, as soon as possible, => IN REAL TIME all interested browsers!
  • Push Technology for Real Time Web by LowerMyBid.com
    • How the other penny auctions sites do this?
  • Push Technology for Real Time Web by LowerMyBid.com
    • How the other penny auctions sites do this?
    • (the dumb ones where you only have to click that dumb button )
  • Push Technology for Real Time Web by LowerMyBid.com
    • How the other penny auctions sites do this?
    • (the dumb push that dumb button ones)?
    • They pull, pull, pull pull pull pull pull pull pull with ajax requests......
  • Push Technology for Real Time Web by LowerMyBid.com
    • How the other penny auctions sites do this?
    • (the dumb push that dumb button ones)?
    • They pull, pull, pull pull pull pull pull pull pull with ajax requests......
    • One request per second!
  • Push Technology for Real Time Web by LowerMyBid.com
    • They pull, pull, pull pull pull pull pull pull pull
  • Push Technology for Real Time Web by LowerMyBid.com
    • What one request per second means:
      • Heavy traffic
      • Heavy load on the server
      • And most important:
    • Over one second of lag (typically 1.5sec)
  • Push Technology for Real Time Web by LowerMyBid.com
    • How are we updating in real time?
    • PUSH TECHNOLOGY
  • Push Technology for Real Time Web by LowerMyBid.com
    • PUSH TECHNOLOGY
  • Push Technology for Real Time Web by LowerMyBid.com
    • What's better?
  • Push Technology for Real Time Web by LowerMyBid.com
    • We only use HTTP ajax request when there is a user action:
    • New page load,
      • we pull the auction time from servers
    • User place a bid
      • We send the bid
      • We update his bid box to let him place a new bid, update his points available & the list of bids he placed
  • Push Technology for Real Time Web by LowerMyBid.com
    • What do we push?
      • After a bid is placed:
        • We update the auction parameters (winner, price etc..)
        • We update the timers variables each time the time change
    • We only send the data when a bid is placed!
  • Push Technology for Real Time Web by LowerMyBid.com
    • What else do we push?
      • For a new auction
        • We push a new partial for the new auction
        • We set the auction variables
        • We remove the future auction partial
    • We only send the data when there is a new auction!
  • Push Technology for Real Time Web by LowerMyBid.com
    • What else do we push?
      • For a closed auction
        • We push the closed auction parameters
        • We wait a bit (for now 1 minute)
        • We then remove closed auction
        • We place that auction in the close auctions pannel.
  • Push Technology for Real Time Web by LowerMyBid.com
    • What else do we push?
      • For a no winner auction (killed)
        • We push the new time in the auction panel
        • We wait a few seconds
        • We then restart the auction
  • Push Technology for Real Time Web by LowerMyBid.com
    • What can we do with real time push?
    • We can do whatever we want on the user side
    • (do I hear God?)
  • Push Technology for Real Time Web by LowerMyBid.com
    • How are we doing this?
      • We push full RJS templates (site is in Rails)
      • We push pure ajax code
      • We address the Javascript variables
  • Push Technology for Real Time Web by LowerMyBid.com
    • How is this setup:
    Web server Database Push server Stream server User Browser
  • Push Technology for Real Time Web by LowerMyBid.com
    • BID:
    Web server Database Push server Stream server User Browser 1 Ajax request 3 Ajax response 2 web server send broadcast in real time 2.1 Pushed real time to browsers
  • Push Technology for Real Time Web by LowerMyBid.com
    • Auctions monitoring:
    Web server Database Push server Stream server User Browser 1 Monitor continuously the DB 2 monitor web server 3.1 Pushed real time to browsers 3 send broadcast in real time
  • Push Technology for Real Time Web by LowerMyBid.com
    • Auctions update:
    Web server Database Push server Stream server User Browser 1 send request to web server 2 web server send broadcast in real time 2.1 Pushed real time to browsers Web server acknowledge
  • Push Technology for Real Time Web by LowerMyBid.com
    • Thank you.
    • To contact me:
    • Facebook: http://www.facebook.com/pages/LowerMyBid/252681494095
    • Twitter: @lowermybid