Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295277

AWS RDS local write forwarding

$
0
0

Problem/Motivation

In large Drupal systems database performance becomes application performance bottleneck. So far I havent come across any viable solutions.

What I have been looking into are:

In December 2023 AWS launched 'Local Write Forwarding' which allows to send DQL (SELECT) and DML (INSERT, UPDATE, DELETE) to reader instance and guarantee data coherence in reader which is required for Drupal. DDL (ALTER, CREATE etc) and other queries need to directly to writer.

Steps to reproduce

Enabling Local Write Forwarding - https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-mysq...

Proposed resolution

As solution I've decided to patch core mysql module. Insert, delete, update, select classes are switched to reader thus anything else is going to writer.

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']['replica'] = [
  'driver' => 'mysql',
  'database' => 'db',
  'username' => 'db',
  'password' => 'db',
  'host' => 'db',
  'port' => 3306,
  'init_commands' => [
    'isolation_level' => 'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED',
  ],
];

At the time of writing this issue, we are testing the solution in development environments. So far it has been successful.

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


Viewing all articles
Browse latest Browse all 295277

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>