I've wrote a little program for my work (IT-Support at university) to record all all inquiries received and evaluate them later.
Because more than one receives inquiries at the same time the program must run on more than on pc simultaneously.
At the moment we are not able to have our own server (e.g. MySQL) so my solution was to write a program that's saving the inquiries to a single file on a fileserver. The file is opened with myStatFile = new File(myFilepath + "/data/statistic.dat");
and wrote to with in = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(myFile, true), "UTF-8"));
. It works pretty well but as the statistic.dat file becomes larger and larger the program needs more time to open the file, write to it and close it.
So my question to the more experienced programmers here is: Is there a more efficient way to do that or is the only possibility to improve the performance to get a server with a database like MySQL? Does anyone see another way without using a server but a simple fileserver?
Edit: First of all I thank everyone who answered my question. I know it's a very broad question with a lot of solutions but after reading your answers I've got an idea of what is possible and what's the way to go now. Thank you!