Question

I have a servlet-based application that runs in a tomcat7 environment.
This application needs to manage users' files in such a way these files can be accessed in many ways and through different classification methods (for instance time-oriented classification and search, keywords, tags, author and so on).

So I have a multidimensional search space and I need to organize a database-based grouping system.

Let focus on a single and specific aspect.
Any user can upload his own files. So I'll have a path in which these files will be saved.

Then I need also a place where to store the informations associated to the files.
I though that it is good to separate files from associated informaions (title, ...) and then to create a third entity that is a small string that univocally identificate both info and file.
This way once i know the file id I can get both the informations (that are stored in a specific file) and the file but I can save this id in any perverse classification table without copying anything heavy.
So If I have the file id (fid) I can get the file and the informations. and when I have for example to associate an object to a file I can simply associate that object to the fid.

Then any user must have its own table that collects the variuos fid of the files he uploaded . Therefore I have one table for each user. Then for any other classification dimension I will have N tables (where N is the size of the dimension). So for instance I want to classify files for keywords, I'll need N tables each for a specific keyboard. (it will be too unefficient to search each time I want files associated to key AGAA through all the users files) So if I need to show the 50 more recent files associated to the keyword "AGAAA" I need a table for AGAAA. and so on.

This is crazy. as the number of users increases I get exponentialy more tables.
I heard about table limit per database in mysql databases. Until now I'm using mysql (mariaDB) with connection pooling. I though to split tables of different "nature" (i.e. those of the keyboards, those fo the time and so on) in different databases (also in order to organize in a clearly way the contents). But with connection pooling I need to declare the database name in the resource definition. So for different databases I will need different pools.

Now questions.

  • Using pooling I must create a different pool resource for each different database access. aint I?
  • If yes, is It a good pratice to use the same database for all the different kind of tables?
  • If no. How can change database runtime?
  • I thought I could manage different tables with different database systems. for example I could use SQLite in order to manage classification tables, mysql to manage user interaction and so on. Is this a good pratice?

  • Is SQLite in general faster than server-based databases in multi-user applications?

  • Can I use connection pooling with SQLite ? I mean, what are SQLite connection if SQLite has no server? and does it make sense to think about connection pooling?
  • What database architecture do you suggest for this kind of problematics?

thanks

No correct solution

OTHER TIPS

Why would each user or keyword need its own table? Tables can have many rows.

Using pooling I must create a different pool resource for each different database access. aint I?

Your question has multiple meanings, but generally you create one pool for one application, and it manages itself.

If yes, is It a good pratice to use the same database for all the different kind of tables? If no. How can change database runtime?

Generally one would use one database for an application.

I thought I could manage different tables with different database systems. for example I could use SQLite in order to manage classification tables, mysql to manage user interaction and so on. Is this a good pratice?

You could, but that would be insane.

Is SQLite in general faster than server-based databases in multi-user applications?

Absolutely not. SQLite can only have one writer at a time, though it is fine for many readers.

Can I use connection pooling with SQLite ? I mean, what are SQLite connection if SQLite has no server? and does it make sense to think about connection pooling?

I don't know, but you shouldn't use SQLite if you expect multiple concurrent users writing / uploading to the database.

What database architecture do you suggest for this kind of problematics?

I would suggest you use a content repository like Apache JackRabbit, or a search server like Apache Solr.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top