I’m currently developing a web application and the client wants to store data around user activity on the site. This is outside of what Google Analytics could provide.
I currently have a nice simple database structure with a minimum number of tables which all relate to the core functionality of the website.
I’m a little begrudged at adding a lot of tables to the database schema to record user activity. And also muddy the code base by adding services to record user activity on the site.
Examples of what they want recording are:
- logins for existing users
- explicit logout by user
- password resets by admin
- password reset/change by user
- change of user account (e.g. grant/remove admin permissions or
profile changes if we have profiles)
They may also want to record
- Search parameters entered into a search form
- access of any (content) page
- selection of any (content) link
- language selection
So my question is:
- Should I just add this functionality to the database and project?
- Should I separate this as much as possible, possibly store this
analytical data in a separate database, or maybe in a different
schema, create a separate project for analytical services. - Are there anymore options?
I just feel recording this data will bulk the code base and database, and have very little gain….
Add this functionality to your project. But not into your database.
Instead, store it as log.
I never like the idea to put this inside your database (especially your production database) because any query to this database will impact your system performance.
However, You also need to create a batch job to read this log, and produce any necessary data from that.
If the log become so big, you should go to Map Reduce approach. Use Hadoop, Hive or any similar products.