Course lesson 46 · Dev Ops & Environments
Creating a Production Instance
A production environment is created with its own storage and messaging resources, mirroring stage without sharing application data. The backend is deployed first, followed by a production-specific Vite build of the user application. A failed dashboard then reveals a separate requirement: provisioning a database does not create the application tables.
Primary source: course video 46 · Supplied English subtitles · 00:08:47.
Understand the idea
- Environment isolation requires distinct R2, D1, KV, queue, and dead-letter resources, not only a different Worker name.
- The user application and data service must reference the same production D1 database where appropriate.
- Workflow names and service targets must also align with the production deployment.
- Frontend build mode selects production configuration and host information.
- Database schema creation is an independent step from creating the database resource.
What the course does
- Copy the stage environment configuration and rename it production.
- Create production R2, D1, KV, main queue, and dead-letter queue resources and insert their identifiers.
- Give the workflow a production-specific name and deploy the data service.
- Configure the user application’s production database and backend service binding.
- Add a production build mode and production environment file, then deploy the frontend.
- Use Drizzle’s introspected SQL definitions to create the required tables in the new production D1 database and reload the application.
Watch for
- The instructor removes remote-development settings from production bindings because local development should use the lower environment.
- The first production page fails because its D1 database has no tables; a successful Worker deployment does not prove database readiness.
- Schema SQL is applied manually here, including correcting statement execution order; this is not an automated migration pipeline.
Recall before revealing
Why can the production Worker deploy successfully while the dashboard fails?
Reveal the explanation
The Worker exists and runs, but queries fail until its separate production database has the expected schema.
Try it
Make a production-readiness checklist from this lesson’s resource and schema steps.
Check your result
It distinguishes creating resources, connecting bindings, building the correct frontend, and creating database tables.
Practice prompts and answer checks are added teaching material. Answer from memory first, then compare and explain any difference.
Rewatch only what you need
Open this lesson in your original course library and seek to the times below. Videos are not hosted on this site.
- 00:00:32 — Create isolated production storage
- 00:02:03 — Production dead-letter configuration
- 00:04:35 — Production-specific Vite build
- 00:06:06 — Diagnose missing production tables
Companion primary documentation: Wrangler environments. For recorded API names, commands, limits, and prices, check the version you use.