Hello! There are a couple of things to keep in mind when dealing with an instance in a cloud (like AWS) and a local instance.
First, AWS instances will run on a remote server somewhere, so network latency of the signal and query will take longer to reach an instance in AWS than it will to connect to an instance running on the same hardware the request comes from.
Second, AWS has different regions to route requests (Europe, Australia, East USA, etc). They are usually optimized to find the best region for your request, but they may not always be going to the fastest place (due to volume of requests, maintenance, or other issues).
@jennifer_reif Thank you,For your valuable information..
But we are maintaining the Neo4j server also in that AWS instance only...
We are hitting from our local machine to the remote Neo4j server which is in AWS instance taking 615ms,but when deployed my local code to remote AWS server pointing to the same AWS Neo4j instance taking 4190ms..
Are the two AWS servers in the same region/datacenter? If the remote AWS server is in a different region or datacenter from the Neo4j instance, it could be slower.
How much data is sent over the line? Maybe the local machine to AWS Neo4j has less latency than between the two AWS servers.
Also, what is the capacity of the remote AWS server? Might be that local has more power and/or bandwidth than the remote AWS server.