# Use replica database for read-only transactions

DevFeed: [Use replica database for read-only transactions](<https://devfeed.tech/articles/use-replica-database-for-read-only-transactions-27317.md>)

Original publisher: [Read original article](<https://blog.pchudzik.com/201911/read-from-replica/>)

Published: 2019-11-27T00:00:00Z

Content type: tutorial

Language: en

Sources: [Paweł Chudzik](<https://devfeed.tech/sources/pawe-chudzik.md>)

Topics: [Transactions](<https://devfeed.tech/topics/transactions.md>), [Spring Boot](<https://devfeed.tech/topics/spring-boot.md>), [MariaDB](<https://devfeed.tech/topics/mariadb.md>), [Replication](<https://devfeed.tech/topics/replication.md>), [Docker Compose](<https://devfeed.tech/topics/docker-compose.md>), [Amazon Web Services](<https://devfeed.tech/topics/aws.md>)

Tags: [aws](<https://devfeed.tech/tags/aws.md>), [docker-compose](<https://devfeed.tech/tags/docker-compose.md>), [mariadb](<https://devfeed.tech/tags/mariadb.md>), [replication](<https://devfeed.tech/tags/replication.md>), [spring-boot](<https://devfeed.tech/tags/spring-boot.md>), [transactions](<https://devfeed.tech/tags/transactions.md>)

## AI overview

This tutorial shows how to configure a Spring Boot application to route read-only transactions to a replica database while continuing to write data to the master. It describes a setup using MariaDB instances, replication, Docker Compose, and AWS RDS, while noting that the example replication configuration is intended for testing rather than production.

## Source excerpt

Some time ago we had a problem with performance caused by generating big reports for users. During one of the firehouse meetings, there was an idea to generate reports from the replica database. We've solved the issue differently but the idea got me interested. In this post, I'll configure spring-boot based application to use the replica database for all read-only transactions. Read more