Answer the question
In order to leave comments, you need to log in
How to collect statistics inside a web application?
There was a need inside the web application to collect statistics on events for each user. In the future, of course, statistics need to be analyzed, so tools are needed to work with such logs.
It is clear that you can write a bicycle: write everything to the database, then write an interface for analysis, or manually make queries to the database.
Nevertheless, maybe there are some ready-made solutions, good practices?
Maybe there are projects like Sentry (error aggregation server), but for statistics?
How do you solve such problems for yourself?
Thanks for answers.
Answer the question
In order to leave comments, you need to log in
We decided head-on and dragged it from project to project: actions table, where it is written, user_id, time stamp, action code, result or error code, comment, service info. We do not observe any problems on >40 projects.
Why they biked - because they could not find anything that meets the requirements for analytics. Here we are the kings ourselves - what we want: we write what we want - we analyze, moreover, according to the sections we want. There was an idea to make a universal tool out of this, but ... somehow the hands did not reach.
Plant options
papertrailapp.com/
loggly.com
Alternative
piwik.org/
Through piwik you can find similar questions habrahabr.ru/search/?q=piwik&target_type=qa
try google analytics. We often use it, and not only on websites, but also in mobile applications to analyze user behavior.
I tried to do it on RDBMS (MySQL), but I didn’t like it - or for each event you need to fence a sign or emulate scheme free. It's easier to take a real scheme free DBMS, I settled on CouchDB. Not for the end user, but almost any front-end developer can write a quick view in JavaScript, after a little specifics training, of course
We have developed an OLAP system specifically for such tasks. The system analyzes user behavior in the cloud service.
Briefly described, it looks like this:
- We periodically load information from the service logs into a data warehouse containing tables with information about user operations (login, page view, file download, etc.)
- Based on the storage, OLAP cubes are built
- Access to OLAP is possible from Excel, or directly through MDX queries, for example, to publish analytics in your application
- Everything was implemented using MS SQL Server
- Data volumes - millions of operations per day
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question