I’ve made a tool that basically displays sitelinks and other info for a Wikidata item: Free Knowledge Portal (Meta-wiki page, see further links there, since this software won’t let me post more than 2 links in a message).
A feature that would be nice would be to keep a record of page visits for each item page, which could then be visualised into graphs and the like. I’m thinking of making an sql database (per https://wikitech.wikimedia.org/wiki/Help:Toolforge/Database#User_databases), with a table with just some columns for item id and date-timestamp of visit, where each visit would be recorded in a row. Then you could get page visits by doing a query that counts the number of rows with a matching item and a date-timestamp within a given range.
So my questions are:
- Is this a sane approach? Or is there a better approach? Or any reason it shouldn’t be done?
- Does it matter that the table would keep growing indefinitely? What sort of limits are there for user databases?
- Apart from basic security measures like escaping/validating/sanitising inputs, is there anything else I should be aware of?