customergauge/aurora

Aurora Connector for Laravel with READ COMMITTED & AWS Secret Manager
21,565 9
Install
composer require customergauge/aurora
Latest Version:2.0.2
PHP:>=8.0
License:MIT
Last Updated:Jan 24, 2025
Links: GitHub  ·  Packagist
Maintainer: abdala

Laravel Aurora Connector 📮

This library creates a new database driver for Laravel dedicated to connect to Aurora. It gives us an opportunity to properly configure the READ COMMITTED isolation as well as load the database password from AWS Secrets.

Installation

composer require customergauge/aurora

Usage

In the config/database.php, we define a connection using the aurora driver

'tenant' => [
    'driver' => 'aurora',
    'host' => env('DB_HOST'),
    'port' => env('DB_PORT),
    'database' => env('DB_DATABASE'),
    'username' => env('DB_USERNAME'),
    'charset' => 'utf8mb4',
    'collation' => 'utf8mb4_unicode_ci',
    'prefix' => '',
    'prefix_indexes' => true,
    'strict' => false,
    'engine' => null,
    'options' => [],
    'aurora' => [
        'secret' => env('AWS_SECRET_NAME'),
    ],
],

You also need set a region inside config/aws.php to be able register AWS Secret Manger Client, this configuration is necessary to set fallback if for some reason the extension or container is not working.

return [
    'region' => env('AWS_REGION'),
    ...
];

The new 'aurora' key will allow the confiugration for the AWS Secret manager.

Isolation Levels

By default we allow Aurora to use read committed from the read replica to reduce history length maintained by the writer replica. If you want to turn it off, go in the database.php, inside the connection that you want and add

        'tenant' => [
            'driver' => 'aurora',
            'isolation_level' => 'off'
            ...
        ],

Click to know more about Isolations Levels

AWS Lambda Extension

This library performs better together with a cache server, more info: https://github.com/cgauge/aws-secretsmanager-caching-extension

Contributing

Contributions are always welcome, please have a look at our issues to see if there's something you could help with.

License

Laravel Aurora Connector is licensed under MIT license.

Related Packages

customergauge/redshift

Redshift Connector for Laravel with AWS Secret Manager

3,542 1
linlancer/laravel-eloquent-mysqli

MySQLi driver (connector) for Laravel 5.4 Eloquent database

60 0
jan-drda/laravel-nosql-connector

Model trait for using various NoSQL systems on Laravel

12 1
shakahl/laravel-eloquent-mysqli

MySQLi driver (connector) for Laravel 8.x Eloquent database

6,261 23
laravel-mysqli/laravel-mysqli-driver

MySQLi driver (connector) for Laravel 5.5 Eloquent database

33 1