Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I want to know what is the best way to store uploaded file.
Is there any performance related issues and benefits between storing in these two ways: (storing in DB and storing in project path)
Which kind of risks can be occurred in each way when retrieving files?
If volume of files (the overall storage that you need) is not high better to use DB. But if there are a lot of large files that need to be uploaded, better to use filesystem.
In case of DB, pros:
All data is in one place so you can easily read all you need from a single place.
DB level permissions can be applied to stored files too.
You can parse/process file contents using DB level procedures.
You can use full-text search of the DB system.
Backup/resore of data will be easier because everything is in DB.
cons:
In case of larger volume of data, storage/retrieval of data will take a lot of time.
For filesystem, pros:
You can handle larger storages.
Cons:
Opposite of all cons of storing data in the database, especially the backup/restore process will be much more difficult and complex.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
My code is simple, it generates a Data Base to store certain data (obviously), but the problem resides in the fact that it would create an "overflow" of DBs becuase every time the class ran it would generate another Data Base, I heard of a command:
CREATE DATABASE IF NOT EXISTS insertYourFavoriteName;
But some people say that why should I need a DB for each computer, when I could just do a central one when users conect, but correct me if I'm wrong, that would make the app depend on internet, right?
So in resume here are the 2 questions:
Does the command mentioned above works? Or does a better version or way to work around it exists?
Data Bases where all users connect to it mean that you need a server, and as a consecuence your app would depend on internet?
If you want to learn about databases you practice basic CRUD operations on that database. After that do some sample applications on database
If you want to create a database if not exists in mysql simply use this CREATE DATABASE IF NOT EXISTS DBName;
Basically before checking all these things you have to have basic understanding of what is database and how it works, So, please go through some good resources and get good understanding on the concepts.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I download a small desktop application.This application stores many information.How they embed database into an application without database setup in computer.I made several search but i don't really understand.
-Are they store this kind of information in txt files?
Thanks in Advance ...
Databases usually thinks in records. If you compare a database table with an Excel spreadsheet that would be a complete row. When you define the database table, you need to tell the database how much space each record will need so it is easy to calculate where any given row number is located simply by multiplying the row number with the space needed for each row.
In the Windows and Linux world most databases are designed to be stand-alone and the various programs needing their services connect with TCP/IP.
Some can also run embedded, where they are part of your application and only service that application which then can fully configure the database. For Java, a typical example is Apache Derby.
You can use sqlite, that is very aprropriate for your purpose.
See http://www.sqlite.org/whentouse.html
There are many ways to save the data. An Application can use simple text files, proprietary binary files or even a full embedded database like SQLite.
For C# there is an easy way like using the application properties, which are automatically saved to disk by the Framework.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
What I am trying to do is cache all the data that I have written into mongodb. So that all client requests are served from the cache. Should I consider ehcache or memcache.
Note the mongodb data is queried a lot, that is why I have thought to cache all of it at server start time, no writes are permitted to this data. I am using java for the application.
It makes very little sense to use a cache in front of MongoDB if you are using it for reads only. An extra cache is just going to take up more memory. MongoDB uses memory-mapped files and the Operating System will keep the most requested data in memory. If all of your data fits in memory, then MongoDB will returns all the documents straight from it - just like an additional cache would.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have a task to create a store system. The language that I use to program is Java and the information MUST to be saved in the pc where the program runs.
As far as I know Access does that perfectly when it comes to Visual Basic since I can use the Access interface and edit some cdoe with VB.
Another option I thought of is creating some kind of my own import/export system that will save the information into files and loads them when needed which will require a lot of extra coding.
So what should I do? What is the best way to do that with Java?
The standard way to do it would probably be to use an SQL database such as sqlite or mysql, but it depends a lot on what sort of system you're designing. Options are really,
SQL Database (such as sqlite)
NoSQL Database (such as couchdb)
Object serialization. You could just serialize objects and dump them to files.
Do you need to handle concurrency with multiple programs reading and writing to the database? Do you need low risk of data loss or corruption, or could you sacrifice some data safety for a quick and easy implementation? Do you need to store a lot of data or just some? How fast does it need to be accessed, and is it accessed all at once or do you need to query certain things?
We'd really need answers to all of those questions to be able to give you a good answer for what's best.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am currently working on a project in which I am storing the name of program/application window titles and my knowledge of databases and datastores is fairly limited.
The idea is that I want to query the database with a string to see if it is present in the database. I am currently using MongoDB to do this but I have seen that MongoDB is mostly used to be run on a server which isn't what I'm looking for.
My question is - if I am just storing strings / searching for strings would a custom Array or HashMap be sufficient or would search times make it inefficient meaning that SQLite would be more ideal for this situation.
SQLite is perfect for this application. Firefox, for example, uses SQLite for storing its internal configuration settings (the about:config page). SQLite databases are single files, and it can be transparent to the user and requires very little in the way of system resources--unlike most server/client database solutions.
i would suggest to use java preferences api, if the data to be saved is not too much and if it needs to be available even when the application is terminated and restarted.,