Skip to content
SQLSimplified
BackendQuestion 43 of 52

Application-Level Read-Write Splitting

Problem

You set up a read-replica database. To leverage it, your application router needs to direct all queries. Write a query that outputs routing_strategy with the value: "The application routes transactional writes (INSERT/UPDATE/DELETE) to the primary database and read queries (SELECT) to read replicas."

Database Schema

This problem acts as a scratchpad. You will write your own DDL/DML or conceptual queries, so there is no predefined schema.

Try It

Loading playground environment...

Hint

Solution