0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-30 19:41:46 +01:00
posthog/ee/clickhouse
Neil Kakkar 9a13ec2c5b
feat(cohorts): Unwrap cohort properties recursively (#9735)
* feat(cohorts): Unwrap cohort properties recursively

* update

* add comment

* reuse func

* fix unwrap and negation bugs

* remove comments

* add comment

Co-authored-by: eric <eeoneric@gmail.com>
2022-05-17 18:28:36 -04:00
..
bin Clickhouse flamegraphs (#5752) 2021-09-08 16:24:44 +03:00
materialized_columns feat(persons-on-events): add groups and persons columns to events schema (#9510) 2022-04-29 11:31:32 +00:00
migrations fix: set kafka_skip_broken_messages on dead letter queue table (#9754) 2022-05-13 10:46:56 +00:00
models feat(cohorts): Unwrap cohort properties recursively (#9735) 2022-05-17 18:28:36 -04:00
queries feat(cohorts): Unwrap cohort properties recursively (#9735) 2022-05-17 18:28:36 -04:00
replication feat(persons-on-events): add groups and persons columns to events schema (#9510) 2022-04-29 11:31:32 +00:00
sql fix: set kafka_skip_broken_messages on dead letter queue table (#9754) 2022-05-13 10:46:56 +00:00
test chore(materialized-columns): make migrations work for future multi-tenant instances (#9612) 2022-05-03 07:48:38 -07:00
views feat(persons-on-events): add groups and persons columns to events schema (#9510) 2022-04-29 11:31:32 +00:00
__init__.py
middleware.py refactor: move event and person query to /posthog (#8970) 2022-03-22 20:27:11 +00:00
README.md Remove references to 'CLICKHOUSE_INITIAL_MIGRATIONS' (#7960) 2022-01-10 12:14:50 +02:00
system_status.py chore(eventserializer): Clean up eventserializer (#9670) 2022-05-17 15:38:58 +01:00
util.py test: Speed up backend tests (#9289) 2022-04-27 13:38:39 +01: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.