---
title: "The Engineering Story Behind Flex Comp"
description: "Shopify built Flex Comp, a system letting employees split total compensation between base salary, RSUs and stock options, under tight deadlines and strict privacy constraints."
url: "https://swe.quest/articles/the-engineering-story-behind-flex-comp-ab1f6b48724dc8fa"
canonical: "https://shopify.engineering/building-flex-comp"
source: "Shopify Engineering"
published: "2022-10-05"
difficulty: "medium"
kind: "Case study"
reading_minutes: 15
tags: ["privacy","cryptography","messaging","react","product-engineering"]
---

# The Engineering Story Behind Flex Comp

A post on [Shopify Engineering](https://swe.quest/sources/shopify.md), published 2022-10-05, 15 min read, Case study. Original: [https://shopify.engineering/building-flex-comp](https://shopify.engineering/building-flex-comp)

## Summary

Shopify built Flex Comp, a system letting employees split total compensation between base salary, RSUs and stock options, under tight deadlines and strict privacy constraints. Access was restricted with a separate GitHub team inside the Shopify org. Sensitive Kafka event payloads were RSA-encrypted (4096-bit, or 6144-bit for larger payloads) so the existing eventing platform could carry them, with only the data team able to decrypt. In hindsight the team recommends hybrid encryption (symmetric payload key wrapped asymmetrically) and adding domain timestamps to payloads. On the front end, early API contracts, a single React Context for API data, and useReducer for interdependent slider state allowed parallel work and fast iteration.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Privacy](https://swe.quest/tags/privacy.md) (Security)
- [Cryptography](https://swe.quest/tags/cryptography.md) (Security)
- [Queues & messaging](https://swe.quest/tags/messaging.md) (Backend & APIs)
- [React](https://swe.quest/tags/react.md) (Web & mobile)
- [Product engineering](https://swe.quest/tags/product-engineering.md) (Engineering organization)

## Prerequisites

- Kafka basics ([easy posts on Queues & messaging](https://swe.quest/tags/messaging.md?difficulty=easy))
- public-key encryption ([easy posts on Cryptography](https://swe.quest/tags/cryptography.md?difficulty=easy))
- React state management ([easy posts on React](https://swe.quest/tags/react.md?difficulty=easy))

## Keywords

Flex Comp, Kafka, RSA, React Context, useReducer, Tailwind, Ruby on Rails, GitHub

## Related posts

- [Workflow SDK 5: built for production](https://swe.quest/articles/workflow-sdk-5-built-for-production-8a4967cc859bc936.md): Vercel · 2026-11-12 · Medium · 9 min read · Serverless, Resilience, Performance engineering, Cryptography, AI agents
  Workflow SDK 5 reworks Vercel's durable async JavaScript workflow engine around security, regional placement and performance.
- [Why and how GitHub encrypts sensitive database columns using ActiveRecord::Encryption](https://swe.quest/articles/why-and-how-github-encrypts-sensitive-database-columns-using-activerecord-4abc36e2a491f04c.md): GitHub Engineering · 2022-10-26 · Medium · 5 min read · Cryptography, Ruby, Databases, Security
  GitHub replaced its internal Encrypted Attributes library with Rails' ActiveRecord::Encryption so developers can encrypt a sensitive column with a single familiar \`encrypts\` call, without hand-provisioning a key per column.
- [Coding Agent Horror Stories: The 29 Million Secret Problem](https://swe.quest/articles/coding-agent-horror-stories-the-29-million-secret-problem-7f5056c95d2769e4.md): Docker · 2026-07-28 · Medium · 12 min read · Supply chain security, AI for coding, Sandboxing & isolation, JavaScript, AI agents
  The s1ngularity supply-chain attack on the Nx npm package used a post-install script to find installed AI coding CLIs (Claude Code, Gemini CLI, Amazon Q) and invoke them with permission-bypass flags like --dangerously-skip-permissions, prompting the agent to inventory secrets across the home directory before exfiltrating them to public repos under the victim's GitHub account.
- [How We Built Slack AI To Be Secure and Private](https://swe.quest/articles/how-we-built-slack-ai-to-be-secure-and-private-8e548d6f05ad3aa4.md): Slack Engineering · 2024-04-18 · Easy · 7 min read · Privacy, LLMs, RAG & retrieval, Security, System design
  Slack AI was designed around four principles: customer data never leaves Slack's trust boundary, no LLM training on customer data, the AI only sees what the requesting user can see, and all existing compliance controls still apply.
- [BuildRock: A Build Platform at Slack](https://swe.quest/articles/buildrock-a-build-platform-at-slack-c8b3b87d529426f6.md): Slack Engineering · 2022-08-31 · Medium · 10 min read · CI/CD, Kubernetes, Infrastructure as code, Build systems, Developer productivity
  Slack consolidated its sprawling, hand-managed "snowflake" Jenkins clusters into BuildRock, a build-as-a-service platform.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
