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 7686703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:32:23+00:00 2026-05-31T19:32:23+00:00

I have an app which will generate 5 – 10 new database records in

  • 0

I have an app which will generate 5 – 10 new database records in one host each second.

The records don’t need any checks. They just have to be recorded in a remote database.

I’m using Java for the client app.

The database is behind a server.

The sending data can’t make the app wait. So probably sending each single record to the remote server, at least synchronously, it’s not good.

Sending data must not fail. My app doesn’t need an answer from the server, but it has to be 100% secure that it arrives at the server correctly (which should be guaranteed using for example http url connection (TCP) …?).

I thought about few approaches for this:

  • Run the send data code in separate thread.

  • Store the data only in memory and send to database after certain count.

  • Store the data in a local database and send / pulled by the server by request.

All of this makes sense, but I’m a noob on this, and maybe there’s some standard approach which I’m missing and makes things easier. Not sure about way to go.

  • 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-31T19:32:24+00:00Added an answer on May 31, 2026 at 7:32 pm

    Your requirements aren’t very clear. My best answer is to go through your question, and try to point you in the right direction on a point-by-point basis.

    • “The records don’t need any checks,” and “My app doesn’t need an answer, but it has to be 100% secure that it arrives at the server correctly.”

    How exactly are you planning on the client knowing that the data was received without sending a response? You should always plan to write exception handling into your app, and deal with a situation where the client’s connection, or the data it sends, is dropped for some reason. These two statements you’ve made seem to be in conflict with one another; you don’t need a response, but you need to know that the data arrives? Is your app going to use a crystal ball to devine confirmation of the data being received (if so, please send me such a crystal ball – I’d like to use it to short the stock market).

    • “Run the send data code in a separate thread,” and “store the data in memory and send later,” and “store the data locally and have it pulled by the server”, and “sending data can’t make my app wait”.

    Ok, so it sounds like you want non-blocking I/O. But the reality is, even with non-blocking I/O it still takes some amount of time to actually send the data. My question is, why are you asking for non-blocking and/or fast I/O? If data transfers were simply extremely fast, would it really matter if it wasn’t also non-blocking? This is a design decision on your part, but it’s not clear from your question why you need this, so I’m just throwing it out there.

    As far as putting the data in memory and sending it later, that’s not really non-blocking, or multi-tasking; that’s just putting off the work until some future time. I consider that software procrastination. This method doesn’t reduce the amount of time or work your app needs to do in order to process that data, it just puts it off to some future date. This doesn’t gain you anything unless there’s some benefit to “batching” data sending into large chunks.

    The in-memory idea also sounds like a temporary buffer. Many of the I/O stream implementations are going to have a buffer built in, as well as the buffer on your network card, as well as the buffer on your router, etc., etc. Adding another buffer in your code doesn’t seem to make any sense on the surface, unless you can justify why you think this will help. That is, what actual, experienced problem are you trying to solve by introducing a buffer? Also, depending on how you’re sending this data (i.e. which network I/O classes you choose) you might get non-blocking I/O included as part of the class implementation.

    Next, as for sending the data on a separate thread, that’s fine if you need non-blocking I/O, but (1) you need to justify why that’s a good idea in terms of the design of your software before you go down that route, because it adds complication to your app, so unless it solves a specific, real problem (i.e. you have a UI in your app that shouldn’t get frozen/unresponsive due to pending I/O operations), then it’s just added complication and you won’t get any added performance out of it. (2) There’s a common temptation to use threads to, again, basically procrastinate work. Putting the work off onto another thread doesn’t reduce the total amount of work needing to be done, or the total amount of I/O your app will consume in order to accomplish its function – it just puts it off on another thread. There are times when this is highly beneficial, and maybe it’s the right decision for your app, but from your description I see a lot of requested features, but not the justification (or explanation of the problem you’re trying to solve) that backup these feature/design choices, which is what should ultimately drive the direction you choose to go.

    Finally, as far as having the server “pull” it instead of it being pushed to the server, well, all you’re doing here is flipping the roles, and making the server act as a client, and the client the server. Realize that “client” and “server” are relative terms, and the server is the thing that’s providing the service. Simply flipping the roles around doesn’t really change anything – it just flips the client/server roles from one part of the software to the other. The labels themselves are just that – labels – a convenient way to know which piece is providing the service, and which piece is consuming the service (the client).

    • “I have an app which will generate 5 – 10 new database records in one host each second.”

    This shouldn’t be a problem. Any decent DB server will treat this sort of work as extremely low load. The bigger concern in terms of speed/responsiveness from the server will be things like network latency (assuming you’re transferring this data over a network) and other factors regarding your I/O choices that will affect whether or not you can write 5-10 records per second – that is, your overall throughput.

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

Sidebar

Related Questions

I have an app in which i have two buttons. Each will generate a
What i need to do is create an app which will generate a random
I am creating an app which will have a question in a UILabel and
I have a requirement on my current project (a Flex app which will be
I have a .Net console App which using a scheduled event will start, call
I have an app which consists of several different assemblies, one of which holds
I have an app which contains a scrollview with several tableviews. Each tableview is
I am writing a app in .NET which will generate random text based on
In one app, I have a task to create files that will be used
I have a facebook application in which I generate pages for each object: www.mydomain.com/object.php?object_id=1

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.