Reading8 min
The Difference Between a Demo and a Product
📦 Module 9: Ship to Production
The Difference Between a Demo and a Product
You built an app. It works on your laptop. You showed it to your manager. Everyone clapped.
Now try running it at 3am on a Tuesday when the network drops, the API returns a 429, and nobody is awake.
That is the difference between a demo and a product.
The 5 Things That Break in Production
Every energy app that goes from sandbox to production hits the same 5 walls:
| # | What Breaks | Why It Breaks | How to Fix It |
|---|---|---|---|
| 1 | Network timeouts | The site's firewall drops idle TCP connections after 60s | Set connect/read timeouts. Retry with exponential backoff. |
| 2 | Rate limits | You loop 500 assets with no delay and get 429s for 60 seconds | Respect rate limits. Add 100ms delays between calls. Batch where possible. |
| 3 | Stale tokens | Your JWT expires mid-run at 4am | Refresh tokens automatically before expiry. Never cache tokens for more than 30 minutes. |
| 4 | Unhandled errors | A single bad meter reading crashes your entire script | Wrap every API call in try/except. Log the error. Continue processing the next asset. |
| 5 | Silent failures | The script runs but stops writing data. Nobody notices for 3 days. | Add a /health endpoint. Monitor it. Alert when it stops responding. |
The Production Mindset
Demo code asks: "Does it work?"
Production code asks: "What happens when it doesn't?"
# Demo code
response = client.read_meter(asset_id=1)
print(response)
# Production code
for attempt in range(3):
try:
response = client.read_meter(asset_id=1)
logger.info("meter_read", asset_id=1, kwh=response["kwh"])
break
except Exception as e:
logger.warning("meter_read_failed", asset_id=1, attempt=attempt, error=str(e))
time.sleep(2 ** attempt)Three retries. Structured logging. Exponential backoff. That is production code.
Log in to track your progress and earn certifications.