Protocells
## Overview
> [!note]
>
> Protocells is the name of our first Cells that is meant to **_replace_** [Cells 1.0](https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/cells/iterations/cells-1.0/), [Cells 1.5](https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/cells/iterations/cells-1.5/), and [Cells 2.0](https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/cells/iterations/cells-2.0/)
[Cells 1.0](https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/cells/iterations/cells-1.0/), [Cells 1.5](https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/cells/iterations/cells-1.5/), and [Cells 2.0](https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/cells/iterations/cells-2.0/) always meant that we're starting to offload from the main database after Cell 1.5+ which is very far out. Cells' mission is to help GitLab.com horizontally scale and take load off the existing Databases. The current scaling limitation factor for GitLab.com is our Main and CI database which has multiple saturation points for example [WAL saturation](https://gitlab.com/groups/gitlab-com/gl-infra/data-access/dbo/-/epics/38) and [LWLocks](https://dashboards.gitlab.net/goto/BZ-3BmsNg?orgId=1) which both result in GitLab.com degradation.
The data below shows that even if after Cells 1.5 if we move some of our largest customers, we won't be removing load off the database and adding loads of risk since we need to have full feature parity. A single large customer is only 2-3% of our load, and the risk of moving these large customers are high. Instead, we should focus on the `other` section which is less risky customers, smaller data to move.
| Type | Web/Git/API | Sidekiq | Notes |
|------|-------------|---------|-------|
| Database duration |  |  | Duration is not a direct correlation for database load but it's a rough proxy |
| main_txn_duration_s |  |  | Transaction duration results into load, dead tuples, and WAL generation |
| Write Queries |  |  | Write queries result into WAL generation |
[unredacted data with sources](https://gitlab.com/groups/gitlab-com/gl-infra/-/epics/1616#note_2593232741)
## Roadmap
{width=754 height=600}
[source](https://lucid.app/lucidspark/85da98d9-fc05-4303-ba9f-9ff082525768/edit?viewport_loc=-2966%2C-1168%2C9350%2C5019%2C0_0&invitationId=inv_ba11d390-cee9-498b-9b5a-635d25d8dd4f)
## Exit Criteria
We will only consider Protocells done and a successful project when we meet the following exit criteria:
- [ ] [WAL saturation](https://dashboards.gitlab.net/goto/eJnH_klHR?orgId=1) remains below 30% during peak hours for at least 30 consecutive days.
- [ ] No more [LWLock spikes](https://dashboards.gitlab.net/goto/DTskqk_Hg?orgId=1) observed when running database migrations or during large spikes in sidekiq workers.
- [ ] All [Patroni capacity planning](https://gitlab-com.gitlab.io/gl-infra/capacity-planning-trackers/gitlab-com/service_groups/patroni/#patroni-sec-service-disk_maximum_capacity) forecasts show at least 2 year of runway:
- [ ] Saturation forecasts: No saturation predicted within forecast window.
- [ ] Hard SLO forecasts: \> 2 years.
- [ ] Soft SLO forecasts: \> 1 year.
- [ ] Availability for Protocells above 99.95%.
NOTE: Database Capacity reports can be found [here](https://gitlab.com/gitlab-org/database-team/capacity-projections/-/work_items?sort=created_date&state=opened&first_page_size=100).
epic