F
F
Fridary2019-12-09 15:43:53
Database
Fridary, 2019-12-09 15:43:53

What is the best database to write a lot of site logs to?

I had a task to write my own system for collecting site visit statistics, something like Yandex Metrics and Google Analytics.
There will be many sites in the pool, I think the total attendance is up to 100k users per day.
The scheme will be similar: a js script is issued, which is hung on the site, it collects the necessary data and sends a record to the server. The tables will contain approximately 50 visitor parameters (IP, User Agent, browser parameters...)
The question arose: how is it more expedient to store data? Which database to choose? Mysql, Postgresql, Mongodb, Redis or friend?
The system statistics will give out not only the value of the visit itself, but it can also be grouped according to different parameters (like in Yandex Metrica).
I also understand correctly that it is enough to make entries in the database from a js script with ordinary ajax requests, or has a more efficient scheme been invented so that the server does not fall by 100k records per day?

Answer the question

In order to leave comments, you need to log in

7 answer(s)
W
WinPooh32, 2019-12-09
@WinPooh32

clickhouse , which was specially designed for Yandex.metrics

K
ky0, 2019-12-09
@ky0

ELK

S
Sanes, 2019-12-09
@Sanes

Just as correctly, I understand that it is enough to make entries in the database from a js script with ordinary ajax requests

No. Must be a web server. And some layer that can pull data from the database and give the result to the web server.

A
Alexey Cheremisin, 2019-12-09
@leahch

Well, in addition to clickhouse, I also recommend kafka with an entry in the same slickhouse or hbase / hadoop. Moreover, data can be pulled out of kafka at any time and for any time (well, you can set it up as a retention). So write in kafka, and aggregate wherever God sends, even to hbase, even to clickhouse, even to postgres.

R
res2001, 2019-12-09
@res2001

I read that PostgreSQL now knows how to store data in columns, like clickhouse.

V
Venya Babiyman, 2019-12-10
@vanyabrovaru

In order not to put the server, it is better to write to a file, then once every half an hour or ten minutes (for example) export to a relational database (postgresql or mariadb is not much difference for your task).
Also provide archival tables (for example, by months or years).
This is how piwik did it, or now it's called matomo.
By the way, why don't you want to use piwik?

B
Barmunk, 2019-12-19
@Barmunk

you can also look at ready-made solutions:
https://medevel.com/best-20-open-source-free-self-...
For example, we use matomo / demo

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question