<p>I have been hired to help write an application that manages certain information for the end user.  It is intended to manage a few megabytes of information, but also manage scanned images in full resolution.  Should this project use a database, and why or why not?</p>

[{'answer_id': 76952, 'author': 'Tom Leys', 'author_id': 11440, 'author_profile': 'https://Stackoverflow.com/users/11440', 'pm_score': 1, 'selected': False, 'text': '<p>Any question "Should I use a certain tool?" comes down to asking exactly what you want to do. You should ask yourself - "Do I want to write my own storage for this data?"</p>\n\n<p>Most web based applications are written against a database because most databases support many "free" features - you can have multiple webservers. You can use standard tools to edit, verify and backup your data. You can have a robust storage solution with transactions. </p>\n'}, {'answer_id': 76965, 'author': 'ahockley', 'author_id': 8209, 'author_profile': 'https://Stackoverflow.com/users/8209', 'pm_score': 0, 'selected': False, 'text': '<p>My gut reaction is "why not?"  A database is going to provide a framework for storing information, with all of the input/output/optimization functions provided in a documented format.  You can go with a server-side solution, or a local database such as SQLite or the local version of SQL Server.  Either way you have a robust, documented data management framework.</p>\n'}, {'answer_id': 76968, 'author': 'Leigh Caldwell', 'author_id': 3267, 'author_profile': 'https://Stackoverflow.com/users/3267', 'pm_score': 0, 'selected': False, 'text': '<p><a href="https://stackoverflow.com/questions/3748/storing-images-in-db-yea-or-nay">This post</a> should give you most of the opinions you need about storing images in the database. Do you also mean \'should I use a database for the other information?\' or are you just asking about the images?</p>\n'}, {'answer_id': 76970, 'author': 'Matt Everson', 'author_id': 7300, 'author_profile': 'https://Stackoverflow.com/users/7300', 'pm_score': 0, 'selected': False, 'text': '<p>Our CMS stores all of the check images we process. It uses a database for metadata and lets the file system handle the scanned images. </p>\n\n<p>A simple database like SQLite sounds appropriate - it will let you store file metadata in a consistent, transactional way. Then store the path to each image in the database and let the file system do what it does best - manage files.</p>\n\n<p>SQL Server 2008 has a new data type built for in-database files, but before that BLOB was the way to store files inside the database. On a small scale that would work too.</p>\n'}, {'answer_id': 76973, 'author': 'nsayer', 'author_id': 13757, 'author_profile': 'https://Stackoverflow.com/users/13757', 'pm_score': 1, 'selected': False, 'text': "<p>The database won't help you much in dealing with the image data itself, but anything that manages a bunch of images is going to have meta-data about the images that you'll be dealing with. Depending on the meta-data and what you want to do with it, a database can be quite helpful indeed with that.</p>\n\n<p>And just because the database doesn't help you much with the image data, that doesn't mean you can't store the images in the database. You would store them in a BLOB column of a SQL database.</p>\n"}, {'answer_id': 77004, 'author': 'NerdFury', 'author_id': 6146, 'author_profile': 'https://Stackoverflow.com/users/6146', 'pm_score': 1, 'selected': False, 'text': '<p>If the amount of data is small, or installed on many client machines, you might not want the overhead of a database.</p>\n\n<p>Is it intended to be installed on many users machines?  Adding the overhead of ensuring you can run whatever database engine you choose on a client installed app is not optimal.  Since the amount of data is small, I think XML would be adequate here.  You could Base64 encode the images and store them as CDATA.</p>\n\n<p>Will the application be run on a server? If you have concurrent users, then databases have concepts for handling these scenarios (transactions), and that can be helpful.  And the scanned image data would be appropriate for a BLOB.</p>\n'}, {'answer_id': 77016, 'author': 'japollock', 'author_id': 1210318, 'author_profile': 'https://Stackoverflow.com/users/1210318', 'pm_score': 0, 'selected': False, 'text': "<p>A database is meant to manage large volumes of data, and are supposed to give you fast access to read and write that data in spite of the size.  Put simply, they manage scale for data - scale that you don't want to deal with.  If you have only a few users (hundreds?), you could just as easily manage the data on disk (say XML?) and keep the data in memory.  The images should clearly not go in to the database so the question is how much data, or for how many users are you maintaining this database instance?</p>\n"}, {'answer_id': 77019, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>If you want to have a structured way to store and retrieve information, a database is most definitely the way to go. It makes your application flexible and more powerful, and lets you focus on the actual application rather than incidentals like trying to write your own storage system. </p>\n\n<p>For individual applications, <a href="http://www.sqlite.org/" rel="nofollow noreferrer" title="SQLite">SQLite</a> is great. It fits right in an app as a file; no need for a whole DRBMS juggernaut.  </p>\n'}, {'answer_id': 77031, 'author': 'Charles Graham', 'author_id': 7705, 'author_profile': 'https://Stackoverflow.com/users/7705', 'pm_score': 0, 'selected': False, 'text': "<p>There are a lot of factors to this.  But, being a database weenie, I would err on the side of having a database.  It just makes life easier when things changes.  and things <em>will</em> change.</p>\n\n<p>Depending on the images, you might store them on the file system or actually blob them and put them in the database (Not supported in all DBMS's).  If the files are very small, then I would blob them.  If they are big, then I would keep them on he file system and manage them yourself.</p>\n\n<p>There are so many free or cheap DBMS's out there that there really is no excuse not to use one.  I'm a SQL Server guy, but f your application is that simple, then the free version of mysql should do the job.  In fact, it has some pretty cool stuff in there.</p>\n"}, {'answer_id': 77061, 'author': 'Seibar', 'author_id': 357, 'author_profile': 'https://Stackoverflow.com/users/357', 'pm_score': 1, 'selected': False, 'text': '<p>You shouldn\'t store images in the database, as is the general consensus <a href="https://stackoverflow.com/questions/3748/storing-images-in-db-yea-or-nay">here</a>.</p>\n\n<p>The file system is just much better at storing images than your database is.</p>\n\n<p>You should use a database to store meta information about those images, such as a title, description, etc, and just store a URL or path to the images.</p>\n'}, {'answer_id': 77231, 'author': 'LizB', 'author_id': 13616, 'author_profile': 'https://Stackoverflow.com/users/13616', 'pm_score': 1, 'selected': False, 'text': '<p>When it comes to storing images in a database I try to avoid it. In your case from what I can gather of your question there is a possibilty for a subsantial number of fairly large images, so I would probably strong oppose it.</p>\n\n<p>If this is a web application I would use a database for quick searching and indexing of images using keywords and other parameters. Then have a column pointing to the location of the image in a filesystem if possible with some kind of folder structure to help further decrease the image load time.</p>\n\n<p>If you need greater security due to the directory being available (network share) and the application is local then you should probably bite the bullet and store the images in the database.</p>\n'}]
['https://Stackoverflow.com/questions/76934', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/13790/']