pirsch-analytics / pirsch

Pirsch is a drop-in, server-side, no-cookie, and privacy-focused analytics solution for Go.
https://pirsch.io
GNU Affero General Public License v3.0
928 stars 43 forks source link

Support other databases #239

Closed nandor-magyar closed 2 years ago

nandor-magyar commented 2 years ago

I really like the project and already using it on hobby projects. Thanks for making it available.

This here is an idea,feature request, an acutal user's pain point.

My biggest pain is setting up and using clickhouse, forcing potential users of this amazing tool - it really is - to use a software that is on various blacklists (probably because yandex relation).

Briefly: (privacy++)--

Is there any plans supporting other type of DBs? I'm happy to even dedicate work to do this, if it is safe to say that there is no strict dependency on any of clickhouse's features.

Kugelschieber commented 2 years ago

Hi Nandor,

it's possible to implement the Store interface to support other storage backends. For sessions, we use the CollapsingMergeTree from ClickHouse. I don't know if there are implementations in other databases that have the same behavior, but it helps to keep query execution fast. Note that Pirsch will store a "cancellation" row for the previous session state, so it inserts two rows for each page visit in the session table (unless for new sessions, where only the initial state is stored as one row). The Analyzer does not use the Store interface, so you would have to fully replace it.

We won't support other storage backends in this repository, as we are unable to maintain them. However, if you would like to contribute, we happily link to your repository in our readme :) It shouldn't be too hard to implement the Store interface, and you could just add the Analyzer queries you actually need.

Btw. ClickHouse recently went to become its own company, independent of Yandex. Also, it's fully open-source, so I don't see any privacy-related issues. I found it very easy to set up on Ubuntu and locally using Docker :)