AWS RDS local write forwarding

Created on 23 December 2024, 1 day ago

Problem/Motivation

I'm wrorking on adding support for AWS local write forwarding which sends some queries from reader to writer https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-mysq...

Steps to reproduce

I've added patch as attachment

Proposed resolution

As solution I've decided to patch core mysql module. Insert, delete, update, select classes are switched to reader.

In Connection class I'm detecting for transactions as local write forwarding does not support SAVEPOINTS. We'll switch everything to writer if these are started.

In setting's I've defined the extra connection

$databases['default']['reader'] = [
  'driver' => 'mysql',
  'database' => 'db',
  'username' => 'db',
  'password' => 'db',
  'host' => 'db',
  'port' => 3306,
  'init_commands' => [
    'isolation_level' => 'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED',
  ],
];

I wanted to ask what do you think of the solution?

💬 Support request
Status

Active

Version

10.3

Component

database system

Created by

🇪🇪Estonia hkirsman

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024