There is a lot more going on with Data API compared to a driver connection.
-
The folllowing only occurs with the DataAPI - You start with a connection that is not established between postman and the web server that
handle your request.
- This web server, as far as I know, is shared and might not have a connection established between itself and your atlas cluster.
- This web server has to interpret your request and create one for the cluster using the driver connection. From here the performance should match what you see from your driver as it is the same.
- The database server handle the request and send the response to the driver.
- Once the web server receive the answer it has to repackage it into an http response. The rest only occurs with Data API.
- You finally can read and process the response.
So a lot more is going on.
Data API is very convenient because it is a layer of abstraction where you do not have to manage an application server. But it comes at a performance cost. You have to be aware of that.