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

  • Home
  • SEARCH
  • 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 3280936
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:45:37+00:00 2026-05-17T19:45:37+00:00

Now I am facing a situation that I’m building a website without mysql or

  • 0

Now I am facing a situation that I’m building a website without mysql or any other databases.
After consideration, I choose to use Xml file for configurations and data storage (And actually I have really no choice).

My problem is that if different users read and modify the same xml file at one time, will there be any synchronization problem or other problems?
If there are, is there a solution?

For a simple bullet-board system, how is the performance of xml (compared with the same system using mysql)?
Any tips for improving the performance?

  • 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-17T19:45:37+00:00Added an answer on May 17, 2026 at 7:45 pm

    Yes, there will quite possibly be synchronization problems.

    Are you deploying on UNIX/Linux? If so, I would do the following. Each time you write a file, create the file with a new temporary filename, in the same directory. Once you’re done, rename the file to be the file you want, overwriting any file that’s already there.

    This has the following consequences:

    • If your program crashes half way through writing an XML file, it doesn’t matter, there is just one extra junk file on the disk
    • As the file is in the same directory, it’s on the same disk, meaning the rename operation is atomic; it either succeeds (in which case you have the new file there) or fails (then you have the old file there). In either case you have a valid file
    • If two processes try and write the same file at the same time, they will both create different temporary files. One of them will win and on the disk afterwards you will have the version that one of them wanted to write. You lose data (double-update problem) however at least you don’t have corrupted data.
    • If another process is in the middle of reading the old file, when it gets overwritten, the read will still continue against the old file as the inode for the file still exists. The OS will delete the file once the last process closes it. Again, the process sees a consistent view of the file.
    • The main problem is the loss of data if two processes write the file at once, or if there is a “load data, process it, write it” procedure which will lose any writes which happen during the “process it” phase. However, this is no different to “SELECT, process, UPDATE” with a database, and is perhaps acceptable.

    To get rid of junk files you could do a find command from crontab to find files older than a day and matching the name schema of your temporary files and delete them.

    If you really need to lock files (i.e. “read, process, write” should not be interrupted by other processes) then you can use some file-locking API offered by the OS. Writing temporary “lock” files is dangerous, as if your process crashes, then they will stay around forever, and then nothing will be able to write to the file.

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

Sidebar

Related Questions

Now that most of the major browsers support full page zoom (at present, the
Now that I know C++ I want to get into desktop application that have
Now that LINQ to SQL is a little more mature, I'd like to know
Now that .NET v3.5 SP1 has been released (along with VS2008 SP1), we now
Now that it's clear what a metaclass is , there is an associated concept
Now that everyone is talking about MVC, I notice that the business rules are
I am new to VB.net and facing a strange situation. I have a structure
I need to set up multiple Sessionfactories in my app, now I'm facing a
now i need to insert some data from the sqlserver into a word,i know
Now, before you say it: I did Google and my hbm.xml file is an

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.