1 of 7

Slide Notes

DownloadGo Live

Background Jobs

Published on Nov 20, 2015

No Description

PRESENTATION OUTLINE

Background Jobs

Ruby Background Processing Libraries
Photo by *nacnud*

Agenda

  • Why Background Jobs?
  • When to use Background Jobs?
  • Which Background Jobs?
  • Demo
  • Q/A

Why?

  • handle time consuming operations
  • separate logic
  • communicate with other servers
Photo by Andrew _ B

examples

  • resizing images
  • fetching data from api
  • uploading data to s3
  • email
  • notifications
  • reading RSS feeds
Photo by Kyle McDonald

When?

  • avoid web requests which run longer than 500ms(0.5 sec)
  • If your app has requests that take one, two, or more seconds to complete, consider using a background job instead.
Photo by MaxC.

Which?

  • Delayed Jobs
  • Resque
  • Sidekiq
  • Beanstalkd

Considerations

  • allow enough time for jobs to complete
  • load testing/ using benchmarks in PROD
  • handle job failures
  • set timeouts for your jobs
  • delayed job & workers, UTC time
  • split up jobs to multiple servers
Photo by anieto2k