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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:25:42+00:00 2026-06-02T06:25:42+00:00

I’m using playframework 1.2.4, and mysql database. I have some tables that are in

  • 0

I’m using playframework 1.2.4, and mysql database.

I have some tables that are in the DB, but are quite static. It is about 100-300 records of 4-7 keys.
I want to move them out of the DB.

In such cases, what would be the best place to store the information?

  • A new play configuration file?
  • XML of some-sort with a parser?
  • JSON/YAML file with access (that id don’t know it of 🙂 ) from playframework/java?
  • Java file that stores all the info in a class?

What’s the best solution and what does playframework preach for in such cases?

  • 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-06-02T06:25:44+00:00Added an answer on June 2, 2026 at 6:25 am

    I would group your options into the following:

    1. Relational Database
    2. XML or JSON (whether that’s a config file or some separate document).
    3. External in-memory caching such as Memcached (also available from within Play).
    4. Store the data as a Java data object, or use Play’s simple, non-distributed cache, which stores the data in the Java heap.

    You have two issues with which you’ll need to deal here: 1.) the performance of accessing your data, and 2.) the maintainability of your dataset. We can deal with these separately.

    Performance

    You have two considerations regarding performance. The first is access/lag time, the second is the amount of data stored in memory. Regarding the access time, the database will certainly have the most lag. Numbers 2 and 3 will vary depending on your hardware and OS — you’ll need to do some testing in your particular setup to really know for sure which is going to perform best. Having to retrieve the XML/JSON file from disk would certainly be much slower than accessing it from an in-memory cache, but Operating Systems are typically pretty intelligent about keeping frequently accessed files available in memory, too. It may be that the overhead of using a caching system ends up being slower than just using a static file.

    Your data will ultimately need to become a Java object in order for you to interact with it from your code. Thus, #1,2, and 3 will all require some serialization of external data into a Java object, which will take some amount of time. Accessing a Java variable (#4) will be the fastest, as it requires no extra serialization.

    Regarding the amount of data stored in memory, #2 and #4 will require that you store the entire dataset in memory each time you run the code (i.e. load any of the relevant pages). This may not be a huge concern for 7 x 300 values (8kB, if they were all floats), but when you’re expecting a single server to serve thousands of clients, that extra memory consumption used on every page load may actually become the bottle-neck for you application. You could alleviate this cost if you were able to store the data statically. Option #3 will only store the data in memory once, then shares that across all requests, which shouldn’t be a big memory penalty. #1 will likely function like #3 (at worst), in that it will store one copy in memory globally. These methods will store one global copy of the data in memory, then only serialize the relevant code into Java objects (perhaps one row of the dataset).

    Finally, note that the downside to using Play’s internal, Java-based cache is that it costs you scalability. Be sure to read the details here.

    Maintenance

    The other concern is how difficult it will be for you to maintain the data. It sounds like you’re opposed to an RDBMS-based solution because of maintenance and deployment concerns. Memcached would probably not offer you much over a database, as you would still need to ensure consistency of the cache across your deployment environments. At that point, you’re left with options #2 and #4. In my mind, it’s much easier to work with a dataset stored in XML or JSON than in Java, so I would say the benefit goes to the XML-based dataset in terms of maintainability.

    Conclusion

    So the best solution for maintenance and deployment is probably XML, the best in terms of performance would be Java-based objects. Thankfully, we can use a tool to get the best of both worlds. PojoXML allows you to convert POJOs (Java objects) to XML and back. Thus, you can maintain your data in XML, then use PojoXML to convert that document to a Java object any time you make changes to your dataset. Then you get the performance benefits of keeping your static data in compiled Java code, with the maintainability of using XML. Just be sure to store the data as a statically so that you don’t consume 8kB of memory for every page load.

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have thousands of HTML files to process using Groovy/Java and I need to
I have a reasonable size flat file database of text documents mostly saved in
I have some data like this: 1 2 3 4 5 9 2 6
I'm new to using the Perl treebuilder module for HTML parsing and can't figure

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.