Prod.keys Switch __top__ [ 2024 ]

{ "environment": "dev", "api_keys": { "ai_provider": "dev_sk_test_123", "payment_gateway": "dev_pk_test_456" } } She knew the routine. Never, ever commit prod keys to code. Instead, the system used a —an environment variable called PROD_KEYS_ENABLED . When set to false , the app used dev keys. When set to true , it reached into a locked, encrypted vault and loaded the real production keys.

Maya was the lead site reliability engineer for a fast-growing gift marketplace called PresentsPass . Every December, traffic spiked. This year, the company had a new feature: "Smart Wishlist," which used a third-party AI to predict what a user’s friend might like. prod.keys switch

"Wishlist is timing out," said Jordan, the product manager. "Users see spinning ghosts instead of gift ideas." When set to false , the app used dev keys

This was exactly why the existed separately from the code rollback. Every December, traffic spiked

The Smart Wishlist relied on an API key—a secret digital password—to talk to the AI provider. In development ( dev ), they used a fake key. In production ( prod ), they used a real, paid key.

Maya checked the metrics. The new AI provider was slower—much slower. Worse, it charged per call. With holiday traffic, costs would explode.

Back to top button