Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7579905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:47:07+00:00 2026-05-30T17:47:07+00:00

This is a multipart question, so please bear with me. I’m developing a web

  • 0

This is a multipart question, so please bear with me.

I’m developing a web based application with java servlets. There will be multiple application servers to load balance the system. These servers access a central remote database (none of them are in a LAN) to carry out the requests. One of the requirements of the system is to be able to dynamically add a new application server to the network and have it be able to connect to the database and start handling requests right away.

My questions:

  • To setup a remote MySQL database server, I need to modify some configuration files to allow external connections. Which files are these and how can I modify them on the fly for new added servers whose IP address is not known until they are actually started up?
  • For remote database access, should I be using connection pooling? Will the connection pooling be done individually for each servlet? How will the pool scale for newly added servers (more requests)?
  • Each request to an application server goes through multiple separate database calls (example: finds and updates). Should I be using the same connection across these operations or releasing it every time?

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T17:47:09+00:00Added an answer on May 30, 2026 at 5:47 pm

    I don’t know much about MySQL, so I won’t answer the first part.

    But yes, you should definitely use a connection pool. Connection setup time will be even worse for a distant database than a nearby one, so reusing connections is even more important.

    Pools can be configured however you like, but are typically per-server, so they will be shared by all the servlets in a given server. If you configure a maximum size to the pool, then the total number of connections at the database will be proportional to the number of servers. This is something to be careful of – i’ve seen databases go down a few times because of inappropriately large pool sizes in large populations of clients.

    Yes, you should reuse a single connection for the duration of each request (probably). For starters, you will have to do this if you want to use a single transaction across the whole request, which you almost certainly do. Aside from that, getting and releasing connections is not free, so reusing one amortizes the cost across several operations.

    One caveat: holding on to a connection for the life of a request may increase the necessary pool size over grabbing and releasing for each operation. Usually, that’s a good tradeoff. But if you are severely constrained by the number of connections, it might not be. It depends to some extent on how long your requests last, and how much database work they do, with shorter, busier requests making better use of a reused connection. If you’re serving huge media streams which can be generated without reference to the database, it’s possible your application doesn’t fit this pattern.

    A final point: if your database is a long way away, you will benefit more than usual from caching. Look hard at whether there is data you can usefully cache, or even store in a local database, at each server, to avoid trips to the central database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think this is a multi-part question, so bear with me. Currently all of
I know this is the repeat question.There are many similar questions are there in
Note: Before reading this question and its answer, please check your input element has
I looked at this question: Uploading multiple files with Django but it did not
This is a multipart question: First, what is your personal opinion of Workflow? Second,
This is a very specific question. I hope there's someone here with good knowledge
I have a Java EE web application using features from the Java EE 6
This is probably a multi-part question. Background: we have a native (c++) library that
This might seem like a stupid question I admit. But I'm in a small
This is a difficult and open-ended question I know, but I thought I'd throw

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.