Can API gateway access to database directly?
We have a client we need to integrated our product using REST API. We already provide some kind of REST API, but it is not suitable for their usage, thus they asked us to provide specific REST API for their usage.
So, we decided to implement API Gateway pattern to call our API and perform some response transformation. And here is the issue. Our API does not provide all the data needed by this customer in responses, but the data are stored in database. And I am wondering if it is OK to talk to database directly from API Gateway or we should create a specific REST API and call that instead.
If you have a kind of database handler that handles access and visibilty concerns it should be okay, but for further purposes you should think about providing database access via REST too, with a user authentication