PHPackages                             nsmithuk/dynamo-queue-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. nsmithuk/dynamo-queue-php

ActiveLibrary

nsmithuk/dynamo-queue-php
=========================

v1.1.0(8y ago)22581MITPHPPHP &gt;=5.5

Since Feb 15Pushed 8y ago1 watchersCompare

[ Source](https://github.com/NSmithUK/dynamo-queue-php)[ Packagist](https://packagist.org/packages/nsmithuk/dynamo-queue-php)[ RSS](/packages/nsmithuk-dynamo-queue-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

DynamoQueue - PHP
=================

[](#dynamoqueue---php)

Overview
--------

[](#overview)

DynamoQueue is a DynamoDB backed queue library. The PHP version provides both queueing and worker components.

DynamoQueue features:

- Each job will be received by one worker, once, and only once.
- The status of jobs in the queue can be tracked by their job ID.
- Jobs will be processed in the order\* in which they are added (\*see [Job Processing Order](#job-processing-order)).
- All the scalability benefits of Amazon’s DynamoDB.
- Jobs can be up to 400 KB in size (see [Messages](#messages)).

Installation
------------

[](#installation)

Simplest is to add the following to `composer.json`:

```
{
    "require": {
        "nsmithuk/dynamo-queue-php": "^1.0"
    }
}
```

And then run:

```
php composer.phar install
```

Initial Setup
-------------

[](#initial-setup)

The first thing needed is to create a suitable table in DynamoDB. This can be done directly form the DynamoQueue Worker client.

```
bin/dynamo-queue --key  --secret  --region  --table  --create

```

Where

- **key** is your AWS access key
- **secret** is your AWS access secret
- **region** is the AWS region you want the table to be in. e.g. eu-west-1, us-east-1, etc.
- **table** the name of the table to create

Alternatively to specifying the key and secret here, they can be specified as environment variables, or set via IAM roles for Amazon EC2 instances. [More details here](http://docs.aws.amazon.com/aws-sdk-php/v3/guide/guide/credentials.html).

A full list of supported regions can be found here: [http://docs.aws.amazon.com/general/latest/gr/rande.html#ddb\_region](http://docs.aws.amazon.com/general/latest/gr/rande.html#ddb_region)

*Note - This command only provisions 1 read and 1 write unit each for the Table and the Global Secondary Index. This is fine for testing but should be changed to a more suitable value for production.*

Starting the worker
-------------------

[](#starting-the-worker)

Once a table has been created a worker can be started using the command

```
bin/dynamo-queue --key  --secret  --region  --table

```

Where

- **key** is your AWS access key
- **secret** is your AWS access secret
- **region** is the AWS region in which you created the table.
- **table** the name of the table you created

Alternatively to specifying the key and secret here, they can be specified as environment variables, or set via IAM roles for Amazon EC2 instances. [More details here](http://docs.aws.amazon.com/aws-sdk-php/v3/guide/guide/credentials.html).

Adding jobs to the queue
------------------------

[](#adding-jobs-to-the-queue)

Assuming you've installed DynamoQueue via Composer, the DynamoQueue client will be available via the autoloader.

```
// First create an instance of the DynamoDbClient from Amazon’s SDK
$dynamoDb = new \Aws\DynamoDb\DynamoDbClient([
    'version' => '2012-08-10',
    'region' => '',
    'credentials' => [
        'key'    => '',
        'secret' => '',
    ]
]);

// Create an instance of the DynamoQueue client
$queue = new \DynamoQueue\Queue\Client( $dynamoDb, [ 'table_name' => '' ] );
```

You can then add jobs to the queue using

```
$queue->enqueue( $processor, $message )
```

Where

- **processor** is the Processor the Worker will use to execute the job. By default in PHP, this should be a full classname (including namespace) of a class that implements the `ProcessorInterface`, that is accessible via the autoloader within the Worker.
- **message** is a string containing the message/instruction to be passed to the Worker. For rich data we recommend this is a JSON string. Binary data is also supported for if you wish to compress and/or encrypt the data.

For example:

```
$jobId = $queue->enqueue( 'DynamoQueueTests\Processors\EchoMessage', "Test Message" );
```

Alternatively you can specify your own unique jobId if you wish:

```
$queue->enqueue( 'DynamoQueueTests\Processors\EchoMessage', "Test Message", "id-1" );
```

Messages
--------

[](#messages)

As per DynamoDB limits, each individual job - including all metadata - cannot be greater than 400 KB.

Realistically however as AWS charge basically on a per KB basis for writes, it’s strongly recommended you make messages as small as possible; ideally less than 1 KB.

This can be aided by:

- Compressing messages before adding them to the queue; or
- Storing the main message elsewhere - in S3 or a database for example - then just passing a reference to the message through the queue.

Job Processing Order
--------------------

[](#job-processing-order)

To aid scalability DynamoQueue supports distributing jobs across partitions. In DynamoQueue’s default configuration of a single partition, jobs are processed in exactly the order they were added to the queue. When more than one partition is used jobs are processed in approximately the order they were added. The greater the number of partitions used, the lower the correlation between when they were added and when they are processed.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~750 days

Total

2

Last Release

2994d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/66f4b8fc2718808076569971dddd8a4ffac98533b684f05d1556126ee2bf963f?d=identicon)[NSmithUK](/maintainers/NSmithUK)

---

Top Contributors

[![nsmithuk](https://avatars.githubusercontent.com/u/480908?v=4)](https://github.com/nsmithuk "nsmithuk (20 commits)")[![iterative-it](https://avatars.githubusercontent.com/u/9396346?v=4)](https://github.com/iterative-it "iterative-it (1 commits)")

### Embed Badge

![Health badge](/badges/nsmithuk-dynamo-queue-php/health.svg)

```
[![Health](https://phpackages.com/badges/nsmithuk-dynamo-queue-php/health.svg)](https://phpackages.com/packages/nsmithuk-dynamo-queue-php)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.4k37.3k](/packages/matomo-matomo)[laravel/nightwatch

The official Laravel Nightwatch package.

3526.1M13](/packages/laravel-nightwatch)[magento/magento2-functional-testing-framework

Magento2 Functional Testing Framework

15511.5M30](/packages/magento-magento2-functional-testing-framework)[tempest/framework

The PHP framework that gets out of your way.

2.1k23.1k9](/packages/tempest-framework)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
