简体   繁体   中英

Slowness in cloud to onpremise Oracle database connection

I have some on-premise based frontend java servlet server, on-premise Java backend app server and one on-premise oracle database server. My Oracle client version is 12.1.0. Java version is openjdk "1.8.0_222". And using tomcat v7.0.55 for frontend servlets. The Architecture is like the backend server communicate with Oracle DB to process SQL queries.

Now I moved all my servers to AWS cloud docker based containers except Oracle DB. And my Java backend server is running on AWS docker is connecting to Oracle DB running in on-premise Datacenter.

Now I am facing an issue where the AWS based application having latency when it connects to on-premise database and the latency keeps increasing as the number of requests grows and eventually the application gets gateway timeout if the requests are keep on increasing. But strangely it will not happen if I connect my AWS tomcat frontend servers to on-premise java backend servers which talks to on-premise Oracle DB. it only happens when the AWS Java backend servers talks to on-premise Oracle DB. I am not sure why this is happening. Any ideas will be highly appreciated.

The issue is related to the DAO / ORM framework we using. If you use something like Hibernate, Spring it will work in a way where SQL calls are not optimized with join statements. So to fetch a 1000 objects there will be 1000+ SQL calls. So if there is a single digit millisecond latency in the network to Database it will boot to 1000 times delay time. So the solution was to keep Database as close as possible with the application.

Is there a way we could configure the same in docker container or hibernate configuration @Matt

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM