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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:48:33+00:00 2026-05-31T08:48:33+00:00

I should choose a persistent storage for my application and therefore I should decide

  • 0

I should choose a persistent storage for my application and therefore I should decide whether to opt for a local database (in SQL Server Compact 3.5 Database) or an XML file. Basically, the application needs to update very frequently some of the data in a table: each row of this table consists of a GUID (as primary key), two DateTime columns, two TimeSpan columns, and four double columns.

This table might consist of thousands of rows, and some of these rows (about 10%) are updated very frequently, where each update consists of the following operations:

  • retrieve the current values ​​related to a GUID;
  • compare these values ​​with some data in order to obtain new values;
  • overwrite the current values with the new values.

The rows that are updated (the above 10%) are not always the same, but they may change gradually during program execution.

If I store this table in an XML file, as soon as the application starts, the Data Access Layer loads the data from the XML file to a Dictionary<Guid, ...> in order to obtain better performance. Then when the application terminates, the XML file is overwritten with the data updated in the dictionary, because I believe that there is no way to update specific portions of an XML file. This is the approach I currently use.

  1. What would be the advantages of using a local database instead of the XML file? I believe that if I use a local database, I could do without the Dictionary<Guid, ...>, then the Data Access Layer would be simpler.
  2. What disadvantages could have the local database than the current “XML/Dictionary based” approach?
  • 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-31T08:48:34+00:00Added an answer on May 31, 2026 at 8:48 am

    If your application crashes, your XML file might not be saved. Or worse, it might be mangled. It is possible to mitigate this bug by wrapping your program in a try/finally and writing the XML in the finally, but this still opens you up to mangling the XML.

    When you use a database, you guarantee that your transaction will be atomic – meaning a write will either fully complete or not happen at all. This is the primary benefit of using a database.

    However, using the XML/Dictionary approach is still very fast due to the fact that it’s all in-memory transactions. As long as you don’t care about data integrity this is a very viable approach.

    As far as a complicated data access layer, this can be an issue with either approach. Just keep this layer separate from your business logic and it shouldn’t affect which you choose.

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

Sidebar

Related Questions

What datatype should I choose for storing an IP Address in a SQL Server?
I have to decide whether I should choose a Flash or a HTML5 presentation
I think Socket.IO should choose The best method to find connection with the server
I ran into a issue about Import/Export on SQL Server. I have a database
I am having trouble finding information related to which i should choose, OpenGL ES
can you just tell me for which type of requirement we should choose framework
When should I choose one or the other? What are the implications regarding space
When should I choose one over the other? Are there any pointers that you
Which graduate program should I choose – SUNY Buffalo or SUNY Binghamton?
Which Eclipse package should I choose for Python development with PyDev ? Nothing on

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.