0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 04:12:23 +01:00
posthog/ee/clickhouse
2022-02-08 13:49:11 +00:00
..
bin
materialized_columns Use structlog over logging (#8155) 2022-01-20 10:48:06 +02:00
migrations Add tags to dead letter queue table (#8345) 2022-02-04 15:36:15 -05:00
models Revert "Adds reserved properties for filtering property definitions (second attempt) (#8349)" (#8485) 2022-02-08 13:49:11 +00:00
queries Revert "Adds reserved properties for filtering property definitions (second attempt) (#8349)" (#8485) 2022-02-08 13:49:11 +00:00
sql Revert "Adds reserved properties for filtering property definitions (second attempt) (#8349)" (#8485) 2022-02-08 13:49:11 +00:00
test Add dead letter queue metrics to system status (#8294) 2022-01-31 15:10:10 -03:00
views Revert "Adds reserved properties for filtering property definitions (second attempt) (#8349)" (#8485) 2022-02-08 13:49:11 +00: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 Dead letter queue initial metrics dashboard (#8347) 2022-02-03 14:56:18 -05: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.