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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:02:07+00:00 2026-05-24T00:02:07+00:00

I have run across many cases where I just want a simple database that

  • 0

I have run across many cases where I just want a simple database that contains about 500 – 1000 strings, each of about 100 characters without the need of updates, and mostly I end up using databases.
So suddenly I’m wondering if I could just use string/text file resources instead. Has anyone tried this before? I’m assuming this should be faster than a normal physical database, but I’m wondering what the memory implications/performance costs will be like. Any advice? Thanks.

  • 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-24T00:02:08+00:00Added an answer on May 24, 2026 at 12:02 am

    That depends on how the strings are used. If they will never change and are never exposed to the user, then setting them as constants in the code itself is sufficient. The memory burden here would be minimal.

    If these are labels or messages that users will see but won’t be updated by the application, then string tables are appropriate. This also allows you to localize your application in the future. The memory required here will be at least as much as the string constants, plus some overhead for the plumbing built in by the resource framework.

    If these strings will be updated by the application (or its users), you’ll need to make provisions in your code for this by storing the strings externally – whether in a database, in an XML file that you (de)serialize, a plain text file, or by some other means. It’s harder to talk about the memory burden here, because you have so many different implementation options.

    As to the memory burden of these strings: you’ve stated that you’ll have (at most) somewhere around 1000 strings. Let’s be generous and call it 1500, just in case. Each string will be around 100 characters long. Characters in .NET are UTF-16, meaning that each takes two bytes. With these assumptions, we can say that your strings will occupy at least 300,000 bytes – approximately 300 KB, allowing for the memory taken by the string objects themselves. Given that you’re using the .NET framework, this kind of memory generally isn’t worth quibbling over.

    EDIT: Performance implications

    Think about how much work your CPU does for each of the above.

    With constants, it’s basically loading a pointer.

    With files, you’re now talking about loading a filename, instructing the OS to open a file, reading its contents into memory, processing the contents, and finding the string you want. That’s a lot more work!

    Now imagine what might be involved simply connecting to a database, let alone getting information out of it.

    You’ll never beat constants for speed. Databases will certainly be orders of magnitude slower, and shouldn’t be considered unless you really need their features. Working with files is much faster than working with databases, but still slower and more error-prone than using constants.

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

Sidebar

Related Questions

I have run across an XML Schema with the following definition: <xs:simpleType name=ClassRankType> <xs:restriction
I have recently run across these terms few times but I am quite confused
I have run into an issue with WPF and Commands that are bound to
I have run into a few cases where i have been asked to deploy
I have came across many situation where I needed to pass value to an
One of the many quirks of Reporting Services we've run across is the complete
I have a simple report sending framework that basically does the following things: It
I have come across a weird problem concerning composite keys and one-to-many relationship. I
I have developed a web application driven by a mysql database that stores information
I have run into a common, yet difficult problem. I do not use Photoshop

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.