Score:0

Best practices for database with direct user input

cn flag

I’m currently working on a dynamic project, in which the users feed the database with new objects/data. Other users can later access the data other users provided.

Because the data’s coming directly from the user, I will sanitize the inputs. Nonetheless I don’t want them to feed data directly into my main database, so I thought of putting a new, temporary database in front of the main one. The idea is, that each newly created user data object is added to the temporary database with a report counter. If the row survives long enough without receiving a certain amount of reports, I want it to be pushed to the main database.

Would you rather use a single database and create separate tables for each the temporary and permanent data, create two separate databases, or do you have any other idea on how to design such a project?

Thanks in advance, I’m happy about everyones opinion!

anx avatar
fr flag
anx
"direct input" is not particularly specific. Maybe you should describe the problem it is meant to solve, not just the possible solution you came up with.
Score:0
my flag

"I don’t want them to feed data directly into my main database" but... why? Just add a field with something like "verified" default 0, or a report counter (?) or even a timestamp of the insert into the table.

I wouldn't do any separate databases, temporary or so on.

The database TYPE is not specified: for example with mariadb (/ mysql) a horizontal sharding is possible (if you have performance problems) in which the records are automatically divided based on a field (as in your request). But I doubt it is necessary

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.