My team is developing a multi-tier API with scalability and modularity in mind. The public access point of the API is fully REST. However, we are splitting the data access layer as another tier in our architecture and this layer will be on another physical server. We decided that RPC would be a good communication protocol between the public facing API and the private data access layer.
We decided to use RPC over REST for the private communication between our tiers because:
- Avoid REST routes duplication between each tier
- Transparency in executing code/functions on different servers
- The communication is private. With good documentation there shouldn't be any problems for the team to understand the communication protocol.
My question are:
- Did we miss advantages or disadvantages in the choice of communication protocol for the private communication between tiers?
- What is normally use to communication between tiers in a multi-tier architecture, especially for web APIs?