Why ClickHouse sizing decides whether Aspects stays usable
If you run Open edX and want course teams to see learner activity, the ClickHouse database behind Aspects is a decision you need to make deliberately, not a default you inherit. Aspects captures tracking logs through the event-routing-backends plugin, converts them to xAPI statements, stores them in ClickHouse via Ralph or Vector, and presents them in Superset dashboards. Every learner click, video play and problem attempt that the platform emits becomes rows in that store, so the platform owner who signs off on Aspects is also signing off on a growing analytical database that must keep answering queries as enrollments grow.
The volume driver is the tracking log itself, not the number of dashboards. Event count scales with active learners, course length, how many interactions each course generates and how long you keep the history. Before you size anything, ask your team to measure tracking log volume from a pilot or a comparable course run, and to project it across a full term including peak enrollment weeks. Confirm with the Aspects maintainers which events the platform emits in your release, because that list determines the baseline. Dashboards are only as responsive as the queries Superset sends, so the same data that is cheap to store can still be slow to report on if the table design does not match the questions course teams ask.
A team should plan ClickHouse explicitly when it expects sustained event volume, needs history kept for multiple course runs, or plans to share the same analytics infrastructure with other workloads. Check the Aspects overview to confirm the pipeline components for your Aspects version before you commit to a topology. The decisions that follow, including managed or self-hosted hosting, replication, backups and keeping analytics off the LMS servers, all depend on that volume estimate, so treat it as the first deliverable of the sizing exercise.
Managed or self-hosted ClickHouse for Aspects
ClickHouse Cloud is the managed service sold by ClickHouse Inc. alongside the open-source server. With it, the provider runs the cluster, so your team hands over most day-to-day database operations. For an Aspects deployment, the question is less about whether the service can store the xAPI events and more about what you give up in control, and what the contract covers.
- Operations: The provider handles server upgrades and cluster maintenance on its schedule. Ask which release channel it uses and how you are told before a change that affects queries.
- Backups: Confirm whether backups are included, how long they are kept, and whether you can run a restore into a separate service. A backup you have never restored is not proof of recovery.
- Keeper and replication: Ask how replication and coordination are handled, and what happens to your data during a node failure.
- Network placement and data residency: Establish the region where data is stored and processed, which sub-processors touch it, and whether learner data can leave your jurisdiction. Your Aspects pipeline must be able to reach the service over an approved path.
- Cost structure: Expect recurring charges for compute and storage, plus any setup work your partner does to connect the pipeline. Ask for the price components in writing and how they change as event volume grows.
Before accepting a quote, get the provider's written answers on backups, regions, sub-processors and support terms, and check them against your institution's data handling rules.
Self-hosted ClickHouse runs the open-source server, licensed under the Apache License 2.0, in your own cloud accounts, data center or private network. Your team, or a partner working for you, owns every operational decision. This gives full control over placement, retention and access, and it means the operating work sits with you.
- Operations: You choose the version, plan upgrades and test them in a pre-production environment with representative data before rollout. ClickHouse recommends stable releases for most production use and reading the changelog first, since minor backward-incompatible changes can occur.
- Keeper: Replicated tables are coordinated by ClickHouse Keeper. The replication guide recommends at least three Keeper nodes on dedicated hosts in production, each with about 4 GB of RAM.
- Backups: Use BACKUP and RESTORE to local disk, S3-compatible storage or Azure Blob Storage, and schedule restore tests on a spare cluster. Replication alone does not protect against human error or corruption.
- Network placement: Keep the database on a private network segment reachable only from the Aspects pipeline and approved query tools. Plan certificates and external authentication, such as LDAP or JWT, from the start.
- Cost structure: Costs are mainly one-time (design, build, first restore test) and recurring (hardware or cloud compute, storage, staff time for upgrades and monitoring). Ask a partner to split its quote by these two groups.
Before committing, confirm who on your team will own upgrades and restore tests, since those tasks recur for the life of the platform.
The choice usually comes down to three things: where your data must stay, how much database operations your team can absorb, and how the cost is structured. Neither option is correct for every institution. The table of questions below helps you compare them on the same terms.
- Data residency: If learner records must stay in a specific region or your own facilities, a managed service needs to meet that requirement in writing. Self-hosting meets it by design, but you carry the infrastructure.
- Staffing: A managed service shifts upgrade and maintenance work to the provider. Self-hosting requires named owners for upgrades, Keeper health and restore tests.
- Recovery: Compare the recovery steps and timings each option commits to, and who runs them. Include a restore drill in the evaluation.
- Growth: Event volume from tracking logs grows with learner activity. Ask how each option scales storage and compute, and who approves the change.
- Exit: Confirm how you would export data and move to another setup if the arrangement ends.
An illustrative comparison: a team with strict residency rules and an existing platform group may favor self-hosting, while a team with a small operations staff and a clear regional contract may favor the managed service. Test both options against your own requirements before deciding.
If you choose ClickHouse Cloud, or a partner that resells or operates it, the quote should describe the service in enough detail to hold the provider to it. Vague answers on backups, regions and support are the most common source of later surprises. Ask for each answer in writing and attach it to the scope.
- Regions and sub-processors: Which regions store data, which sub-processors access it, and how changes to either are announced.
- Backups and restores: Backup frequency, retention, where copies are stored, and whether you can run a restore into a separate environment during the contract.
- Upgrades: Which releases the provider runs, how maintenance windows are set, and how breaking changes are communicated before they affect your queries.
- Access and identity: Which authentication methods are supported for your users and pipeline, and how administrator access is logged.
- Pricing components: Compute, storage, data transfer and support, with each recurring cost named and any one-time setup charges listed separately.
Also ask your partner what work it will do on your side, such as connecting Aspects, writing dbt transformations and testing restores, so the quote covers the whole job.
ClickHouse configuration options and when each fits
This table compares the ClickHouse choices that shape an Aspects deployment: topology, Keeper placement, release line, backup target and authentication method. Read each row for the condition that makes an option fit and the cost it brings with it. The main takeaway is that a single node is simpler to run but leaves no replica to fail over to, so the replication and backup rows should be decided together.
| Option | When it fits | Trade-off |
|---|---|---|
| Single node, non-replicated tables | Non-production environments, proof-of-concept Aspects installs and test loads with data you can rebuild | No replica to take over if the host fails, and backups become the only recovery path |
| Replicated tables (ReplicatedMergeTree) | Production event stores where losing the analytics host would interrupt course team reporting | Adds ClickHouse Keeper to operate and more hosts to patch, monitor and size |
| ClickHouse Keeper on dedicated hosts | Production replication, where the replication guide recommends at least three Keeper nodes on dedicated hosts with about 4 GB of RAM each | Extra servers to provision, and Keeper must be sized and monitored separately from ClickHouse |
| Keeper co-located with data nodes | Small test clusters where the team accepts reduced isolation between coordination and query load | Keeper competes with queries for memory and I/O, which the replication guide advises against for production |
| Stable release line | Most production use, as the ClickHouse production FAQ recommends stable releases, with a pre-production environment running representative data first | Upgrades arrive about monthly, so the team needs a routine to read changelogs and test before rolling out |
| LTS release line | Teams that want fewer upgrade cycles and can plan a yearly move between LTS lines | LTS releases ship twice a year and are supported for a year, so you still need an upgrade plan before support ends |
| Backup to local disk | Quick restores on the same host during routine work, with copies kept off the server as well | Shares failure domains with the database, so a host loss can take the backup with it |
| Backup to S3-compatible storage | Organization-controlled object storage that is separate from the ClickHouse hosts | Needs credentials, bucket policies and restore tests against the same storage |
| Backup to Azure Blob Storage | Organizations already running Azure storage that meet their data residency rules | Adds a cloud dependency and access policy to review, and restores must be tested like any other target |
| LDAP or Kerberos external authenticators | Sites that already manage analytics users in a directory or identity service | Directory availability affects analytics access, and the group mapping needs review |
| X.509 certificates or JWT authentication | Service-to-service access or environments issuing short-lived tokens from an existing identity provider | Certificate or token lifecycle must be managed, including rotation and revocation |
Setting up ClickHouse for Aspects in order
This sequence takes ClickHouse from a version decision to a tested, access-controlled cluster that receives Aspects events and can be restored from backup. Each step ends with a check so the next step only starts once the previous one is proven.
Confirm the Aspects version and pipeline
Your team confirms which Aspects release is installed and whether events flow through Vector or Ralph, since the pipeline choice sets the settings and database changes the rest of the work depends on. Confirm the ClickHouse version the Aspects release supports, then pick a stable or LTS line from the ClickHouse support policy rather than the newest release by default. Check the ClickHouse security policy for the versions still receiving security updates. The step is done when the Aspects version, pipeline and ClickHouse version are written down and the version is on the supported list.
Build a pre-production environment with representative data
Build a non-production ClickHouse instance and load a copy or realistic sample of tracking-log events that matches your expected course count, learner count and retention period. Run the dashboard queries your course teams will use against it and record query times and memory use. ClickHouse's production guidance recommends this environment before any upgrade, and it is where you will learn your real event volume. The step is done when the sample load completes, the dashboards render, and the results are recorded for comparison against production sizing.
Deploy ClickHouse Keeper on dedicated hosts
Deploy ClickHouse Keeper, which coordinates replicated tables in place of ZooKeeper, with at least three nodes on dedicated hosts for production. The replication guide suggests about 4 GB of RAM per Keeper node, so confirm the host sizes with your infrastructure team. Keep Keeper off the ClickHouse data nodes so a data-node failure does not remove quorum. The step is done when all three Keeper nodes report a healthy ensemble and a test write survives the loss of one node.
Deploy ClickHouse and wire Aspects to the cluster
Deploy the ClickHouse data nodes with ReplicatedMergeTree tables, then point the Aspects pipeline at the cluster using the connection settings for your chosen pipeline. Keep analytics writes and dashboard queries on ClickHouse, not on the LMS or its MySQL database, so learner-facing servers stay responsive. Confirm the database and tables Aspects creates match the ones the pipeline expects. The step is done when a learning event generated in a test course appears in the expected table on each replica.
Configure users and access control
Create separate ClickHouse users for the ingestion pipeline, the dashboard tool and administrators, and grant each only the database privileges it needs. Decide whether authentication uses local accounts or an external authenticator such as LDAP, Kerberos, X.509 certificates or JWT, and confirm the option with your identity team. Avoid sharing the default account between services. The step is done when each service connects with its own account, a test query outside its grants is refused, and the access list has been reviewed by the owner of the learner data.
Set up backups to separate storage
Configure scheduled BACKUP jobs for the Aspects databases to storage outside the cluster, such as local disk, S3-compatible storage or Azure Blob Storage, with incremental backups after the first full one. Replication keeps replicas in sync but does not protect against human error or corruption, so backups must exist as a separate copy. Record the schedule, retention and the person who owns each job. The step is done when the first full backup and at least one incremental backup complete and appear in the target storage.
Run a restore test on a spare cluster
Restore the most recent backup onto a spare ClickHouse cluster that is not connected to the live pipeline, then query the restored tables and compare row counts and sample dashboard results with production. ClickHouse's backup guidance warns that a backup never test-restored will probably not restore properly when needed, so schedule this test on a recurring basis. Record the time the restore took and any manual steps required. The step is done when the restored data matches the source, the procedure is written as a runbook, and the owner has signed off on the recovery time they can achieve.
How data moves from the LMS to ClickHouse and dashboards
Tracking events start in the LMS, where event-routing-backends converts them to xAPI statements. A pipeline stage, either Ralph or Vector, carries those statements into a ClickHouse cluster whose replicas are coordinated by ClickHouse Keeper. dbt transforms the raw tables, and Superset reads the results. The dashed trust boundary marks the analytics network, which should sit apart from LMS servers. Check each hand-off for credentials, network rules and failure handling.
Event flow from LMS tracking logs to dashboards, with the analytics network separated from LMS servers.
Securing and operating the analytics database
The ClickHouse database holds learner event data, so access, network placement, secrets and recovery need decisions before the first Aspects pipeline runs. The cards below cover the controls to design and the checks to run on each one.
Roles for Aspects and dbt
Give the pipeline writer, the dbt transformation user and the Superset reader separate database accounts with only the grants each needs. Writers should not hold rights to drop tables, and dbt should not be able to change access rules. Review the grants during the sizing exercise, because a shared admin account is the most common shortcut. Confirm the exact table and database names with the Aspects documentation for your release before writing the grants.
Access control docsExternal authentication options
ClickHouse can delegate sign-in to LDAP directories, Kerberos, SSL X.509 certificates, an HTTP authenticator or JWT tokens. Decide which option matches the identity system your analytics staff already use, and keep a local break-glass account documented and stored offline. Test a failed directory lookup, because the database must still fail closed when the directory is unreachable.
External authenticators docsNetwork isolation from the LMS
Place ClickHouse on its own network segment and allow connections only from the pipeline hosts, dbt runners and Superset. The LMS web and worker servers should have no route to the database port, so a compromised LMS process cannot query or alter analytics data. Verify this with a connection test from an LMS host after each network change.
Encryption and secrets
Encrypt connections to the database with TLS and keep database passwords, certificates and backup storage keys in your secrets manager rather than in Tutor configuration files or dbt profiles committed to version control. Rotate credentials on a schedule and after staff changes. Confirm with your security team how encryption at rest is handled for the disks and backup targets you choose.
Backups against human error
Replication keeps copies of data across replicas, but it copies a bad delete or a corrupted table just as faithfully. Schedule full and incremental BACKUP jobs to storage separate from the cluster, such as S3-compatible or Azure Blob Storage, and restrict who can delete backup objects. Keep backups on a retention period your data policy sets.
Backup and restore docsRegular restore tests
A backup that has never been restored will probably fail when you need it. Run restores into a spare cluster on a fixed schedule, check row counts and key dashboards against the source, and record how long recovery took. Make the restore test a named operations task with an owner, and treat a failed test as an incident.
Questions teams ask before running ClickHouse for Aspects
How much effort and cost should we expect to run ClickHouse for Aspects?
The effort depends mostly on how much event volume Aspects will receive, whether you run ClickHouse yourself or buy a managed service, and how many environments you keep. Cost has three parts: infrastructure (compute, storage, and at least three ClickHouse Keeper nodes on dedicated hosts in production, each with about 4 GB of RAM according to the ClickHouse replication guide), people time for setup and upgrades, and backup storage. Infrastructure and backup costs recur monthly, while the initial build is one-time. Ask any quote to separate these components and to state which environments, retention period and backup targets it assumes.
Does managed ClickHouse remove the operational work for Aspects?
Managed ClickHouse removes some of the work, mainly node provisioning and part of the patching, but it does not remove the design work. You still decide retention, the table layout that the dbt transformations depend on, access for Superset users, and how the data is restored after an error. ClickHouse Inc. sells ClickHouse Cloud as a managed service, while the server itself is open source under Apache-2.0, so the licensing question is separate from the hosting question. Confirm with any managed provider which backup, restore and upgrade tasks it handles and which remain yours.
How long does a pilot take and what does it need from our team?
A pilot is usually shaped by how much representative data you can load and how many people must review it. You need someone who can run Aspects on a test LMS, someone who owns the ClickHouse cluster, and a course team contact who checks whether the dashboards answer real questions. The ClickHouse production FAQ recommends a pre-production environment with representative data and queries, so the pilot should use realistic event volumes rather than a small sample. Ask the implementation partner to write the pilot scope, its exit criteria and its timeline before work starts.
Can our own team run ClickHouse for Aspects without outside help?
Yes, if your team already runs stateful clustered databases and can own replication, backups, monitoring and upgrades. The main gaps are usually Keeper operations, backup restore testing and keeping pace with ClickHouse releases. The ClickHouse security policy lists which versions receive security updates, and stable releases ship roughly monthly, so an upgrade calendar is required. A partner can build the cluster, document the runbooks and train your staff, or support the platform on retainer, which DeployOpen offers for ongoing support and upgrades.
How should we test ClickHouse backups before we rely on them?
Test restores on a spare cluster, not on the production system, and do it on a schedule. The ClickHouse backup documentation warns that a backup never test-restored will probably not restore properly when needed. Use BACKUP and RESTORE for full and incremental backups of tables, partitions or databases, and target the storage you actually have, whether local disk, S3-compatible storage or Azure Blob Storage. Record how long each restore takes, check row counts and a few dashboard queries after restore, and remember that replication alone does not protect against human error or corruption.
Why should Aspects analytics stay off the LMS servers?
Analytics queries scan large volumes of event data, and running them on the LMS application servers competes with learners for CPU, memory and database connections. Keeping ClickHouse on its own hosts, fed by the event pipeline, means heavy reporting cannot slow down course delivery. It also lets you size, patch and back up the analytics stack separately. Confirm the network path from the LMS event routing to ClickHouse, the credentials each component uses, and which Superset or dbt jobs are allowed to read the data.
How do we control access to ClickHouse data?
Access should follow the same rules as learner data, so decide who may query identifiable events before you grant any account. ClickHouse supports LDAP authentication and directories, Kerberos, SSL X.509 certificates, an HTTP authenticator and JWT authentication as external authenticators, and it supports role-based access control. Map these to your identity provider and create separate accounts for the pipeline, dbt and dashboards. Ask your team to confirm which options fit its directory and audit requirements.
Keeping analytics load off the LMS servers
Analytics work should run on its own hosts and databases, separate from the LMS and Studio servers that learners and authors use. The LMS database serves enrollments, grades, sessions and course delivery, and its latency is what learners feel. Aspects writes tracking events into ClickHouse continuously, dbt transformations rebuild tables on a schedule, and Superset dashboard queries can scan large date ranges. Any one of these can consume CPU, memory, disk I/O or connection slots that the LMS needs during a course launch or exam window. Keeping them apart means a heavy report or a stuck transformation slows only the analytics stack, not learner sessions.
The separation is mostly a network and credential decision. Give the event router, the ClickHouse cluster, the dbt runner and Superset their own hosts or namespaces, and allow only the connections each one needs: the event pipeline writes to ClickHouse, dbt reads and writes analytics tables, and Superset reads. The LMS should not hold credentials for the ClickHouse cluster, and no dashboard user should reach the MySQL database behind the LMS. Confirm with your Aspects version's documentation which database credentials the pipeline and Superset actually require, then restrict firewall rules and ClickHouse users to those accounts. ClickHouse supports external authenticators such as LDAP and JWT, so you can tie database access to the same identity source your administrators already use.
The separation changes how you run upgrades and troubleshoot. An Open edX upgrade or Tutor change on the LMS host should not require the analytics cluster to go down, and an analytics upgrade should not force an LMS maintenance window. Plan the two upgrade calendars separately, and test the event pipeline against the new LMS release in a pre-production environment with representative data. When something breaks, the first question is which side owns the failure. Keep separate logs, metrics and alerts for the LMS and the analytics hosts, so an engineer can tell whether missing dashboard data comes from the event pipeline, a dbt failure or a ClickHouse replica problem without reading LMS logs first.
How DeployOpen scopes and delivers ClickHouse for Aspects
DeployOpen plans, builds, tests and documents the ClickHouse database behind Open edX Aspects inside infrastructure you control. Engagements are fixed-scope, with sizing, topology, backup and handover agreed in writing before work starts.
How we scope
- Review your expected tracking log volume, retention periods and reporting questions before recommending a topology.
- Agree in writing whether ClickHouse runs on your servers, in your cloud accounts or as a managed service you contract separately.
- Define what the fixed scope covers, including dbt transformations, Superset access, backups and restore testing.
How we build
- Deploy ClickHouse with replicated tables, a dedicated Keeper ensemble and a pre-production environment loaded with representative data.
- Configure authentication for ClickHouse users, roles and external authenticators in line with your identity model.
- Keep analytics workloads off LMS servers by placing ClickHouse and dbt jobs on separate hosts with defined network paths.
How we hand over
- Deliver runbooks for version upgrades, reading the changelog and validating in pre-production before production changes.
- Document backup schedules, restore procedures and a restore test performed on a spare cluster before handover.
- Provide sizing notes that show the assumptions behind storage, memory and Keeper node decisions for your team to review.
How we support
- Offer ongoing support, upgrades and periodic restore tests as a retainer after the initial delivery.
- Track ClickHouse supported version lines and plan upgrades around the current security policy.
- Confirm with your team who owns on-call response, capacity reviews and changes to retention before the retainer starts.

