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

Queuing in PHP

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

Queuing in PHP

Queuing management systems and PHP, based on Redis and RabbitMQ

Avatar for Radosław Zagórski

Radosław Zagórski

October 24, 2018

More Decks by Radosław Zagórski

Other Decks in Programming

Transcript

  1. Service discipline FCFS - First - Come - First -

    Serve LCFS - Last - Come - First - Serve SIRO - Service In Random Order Priority service
  2. Applications od Queuing Model - telecommunication - traffic control -

    determining the sequence of computer operations - health services (bed assignments) - airline ticket sales - manufacturing systems - mail services - payment gateways - invoices
  3. Redis Redis is an open source (BSD licensed), in-memory data

    structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries. Redis has built-in replication, Lua scripting, LRU eviction, transactions and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.
  4. Why (not) RabbitMQ? + Most developers agree (Although open for

    debate) that RabbitMQ is the best message broker on the planet today. It can be configured to use SSL thereby providing additional layer of security. + Most people like the Interface for RabbitMQ. Much more versatile when compared to Redis as a message broker. + Offers clustering and is very good at it. + Scales to around 500,000+ messages a second. - Needs Erlang. - Minimal configuration that can be done through code. (Configuring RabbitMQ is something that must be done first before even implementing your task queue.) - Since our comparison is with Redis one can also say that for non extensive message brokers Redis obtains a slight edge due to its ability to multi-task.
  5. Why (not) Redis? + Since it has dealings with a

    system's main memory Redis is fast and also scalable. + Extremely easy to set up, use and deploy. + Provides in-memory and advanced key-value cache. - Redis was created with a different intentions and not for being a message broker. It does support basic operations as a message broker however for powerful message routing Redis is not the preferred option. - High latency in dealing with large messages. Redis is better suited for small messages.