John Davidson

php - Setting Aurora Read replica consistency parameter in laravel

0 comments
Message:


I am setting up multi-region and for that I am using AWS Aurora, with primary cluster in one region(reader-writer) and secondary cluster having only reader instance
Now, reader instance has write-forwarding on to support DML queries on secondary instance. For that we need to set up
set aurora_replica_read_consistency = 'session',
for each session according to AWS docs
If we try to setup this parameter on writer, this will give error
Is there any way we can set this parameter for each DB session on reader instance in configuration?
Otherwise, I need to use
DB::statment('set aurora_replica_read_consistency = "session"');
whenever I am making a DB connection
enter image description here



My Answer:
'session')->execute();_before running any queries on the reader instance in Laravel.

Rate this post

4 of 5 based on 5014 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us