0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 04:12:23 +01:00
posthog/ee/clickhouse
Eric Duong cdf4164c97
Remove paths viewset (#8175)
* remove-paths-viewset

* don't try to import
2022-01-25 11:14:48 -05:00
..
bin Clickhouse flamegraphs (#5752) 2021-09-08 16:24:44 +03:00
materialized_columns Use structlog over logging (#8155) 2022-01-20 10:48:06 +02:00
migrations chore(pdi): add data migration for pdi to pdi2 (#7792) 2022-01-04 15:34:12 +02:00
models Make backend not care about DateTime format (#8230) 2022-01-25 10:01:08 +01:00
queries [Proposal] Add automatic swagger doc generation (#8148) 2022-01-24 17:21:56 +00:00
sql Recordings in paths (#8015) 2022-01-18 15:29:52 -08:00
test Fix lifecycle rounding logic (#8057) 2022-01-18 09:52:49 +02:00
views Remove paths viewset (#8175) 2022-01-25 11:14:48 -05:00
__init__.py
client.py fix(retention): add regression test for not_icontains filter (#7748) 2021-12-17 10:13:38 +00:00
demo.py Update mypy and typed-ast, fail early if db version not in range (#7599) 2021-12-10 09:29:04 +01:00
errors.py
middleware.py Yeetcode (#7830) 2022-01-18 14:32:28 -05:00
README.md Remove references to 'CLICKHOUSE_INITIAL_MIGRATIONS' (#7960) 2022-01-10 12:14:50 +02:00
system_status.py show last event ingested timestamp in system status (#7979) 2022-01-11 14:17:10 +00:00
timer.py Use structlog over logging (#8155) 2022-01-20 10:48:06 +02:00
util.py Remove hooks for person/person_distinct_id deletion (#7671) 2021-12-15 15:45:10 +02:00

Clickhouse Support (Enterprise Feature)

To accomodate high volume deployments, Posthog can use Clickhouse instead of Postgres. Clickhouse isn't used by default because Postgres is easier to deploy and maintain on smaller instances and on platforms such as Heroku.

Clickhouse Support works by swapping in separate queries and classes in the system for models that are most impacted by high volume usage (ex: events and actions).

Migrations and Models

The django_clickhouse orm is used to manage migrations and models. The ORM is used to mimic the django model and migration structure in the main folder.

Queries

Queries parallel the queries folder in the main folder however, clickhouse queries are written in SQL and do not utilize the ORM.

Tests

The tests are inherited from the main folder. The Clickhouse query classes are based off BaseQuery so their run function should work just as the Django ORM backed query classes. These classes are called with the paramterized tests declared in the main folder which allows the same suite of tests to be run with different implementations.

Views

Views contain Viewset classes that are not backed by models. Instead the views query Clickhouse tables using SQL. These views match the interface provide by the views in the main folder.