Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Queues & Async Apps

Tony Messias
February 23, 2017

Queues & Async Apps

Tony Messias

February 23, 2017
Tweet

More Decks by Tony Messias

Other Decks in Programming

Transcript

  1. SERVER PROVISIONING SERVICE ➔ CREATE A NEW SERVER ◆ SPIN

    UP A NEW SERVER INSTANCE ◆ WAIT FOR IT TO BOOT ◆ PROVISION THE SERVER (INSTALL BASE DEPENDENCIES - LIKE GIT, PHP...) ◆ NOTIFY THE USER THE SERVER IS READY (APP NOTIFICATION, SLACK…) ◆ DONE!
  2. QUEUES ➔ BROKER (AKA. MESSAGE BROKER): SOME INTERMEDIARY TOOL USED

    TO EASILY SEND MESSAGES BETWEEN TWO APPLICATIONS; ◆ REDIS, DATABASE, RABBITMQ, BEANSTALKD, FILESYSTEM... ➔ WORKER: SOME APPLICATION/PROCESS THAT ACTS AS A “CONSUMER” FOR THE QUEUE MESSAGES/JOBS. ◆ CAN BE A DIFFERENT SERVER OR EVEN IN DIFFERENT LANGUAGES
  3. MORE ABOUT QUEUES ➔ YOU CAN SPLIT YOUR JOBS INTO

    CHANNELS AND HAVE APPROPRIATE WORKERS PROCESSING PER CHANNEL; ➔ CHOOSE A GOOD MESSAGE BROKER, LIKE AWS SQS FOR PRODUCTION; ➔ BE AWARE OF CONCURRENCY PROBLEMS BETWEEN WORKERS AND RESOURCES; ➔ PREPARE FOR FAILURE: WHAT SHOULD HAPPEN?
  4. TCP

  5. TCP FEATURES ➔ CONNECTION-ORIENTED; ➔ DATA IS BROKEN IN ENVELOPES/PACKETS

    TO BE DELIVERED PIECE BY PIECE; ➔ PERSISTENT CONNECTION.
  6. WEBSOCKETS FEATURES ➔ APPLICATION LAYER PROTOCOL (LIKE HTTP); ➔ USES

    TCP; ➔ BI-DIRECTIONAL, FULL-DUPLEX COMMUNICATION BETWEEN WEB BROWSERS AND WEB SERVERS.
  7. MORE ABOUT PUSHER... ➔ ACCESS CONTROL ➔ INTEGRATIONS ➔ CLIENT

    EVENTS ➔ FREE FOR <=200K MESSAGES/DAY && <=100 SIMULTANEOUS CONNECTIONS
  8. REFERENCES ❏ https://speakerdeck.com/igorw/websockets-confoo ❏ https://changelog.com/podcast/31 “The WebSocket Protocol” ❏ https://www.3pillarglobal.com/insights/rabbitmq-understanding-mes

    sage-broker ❏ https://laravel.com/docs/5.4/broadcasting ❏ https://laravel.com/docs/5.4/queues ❏ http://kr.github.io/beanstalkd/ ❏ https://github.com/tonysm/laravel-queue-async-apps-example