Environments4:50 with Alena Holligan
Applications will typically follow a workflow comprised of different environments such as development, testing, and production. Each environment may connect to different sources with different credentials. As a developer, we need ensure that our code will work effectively and connect properly in each environment.
Typical Work Flow
The process of implementing a new feature or bug fix should follow a well-defined workflow
- Local Development
- *Development (Dev)
- Testing /Quality Assurance (QA)
- *Production (Prod)
*most important. DO NOT develop on production!
Learn more about Basic Error Handling in PHP
A sandbox is a testing environment that isolates untested code changes and outright experimentation from the production environment or repository, in the context of software development including Web development and revision control.
The term sandbox is commonly used for the development of Web services to refer to a mirrored production environment for use by external developers. Typically, a third-party developer will develop and create an application that will use a web service from the sandbox, which is used to allow a third-party team to validate their code before migrating it to the production environment. Most of the major player on the internet provide sandboxes for use with their services, including Microsoft, Google, Amazon.com, Salesforce.com, PayPal, eBay and Yahoo. Read More
[MUSIC] 0:00 Welcome to the Treehouse Cafe. 0:09 I'm Alena and I'm glad that you could join me for 0:11 a cup of coffee as we talk about environments. 0:14 You may have noticed that this isn't the normal setup for our instructional videos. 0:17 If you've seen the treehouse show, it may look familiar. 0:21 We use different environments for different projects, and 0:25 we're constantly looking for ways to improve those environments. 0:28 Your life is filled with different environments for 0:32 different actions, eating, sleeping, working, playing. 0:34 Programming is similar. 0:39 Your code will need to run in different environments for different reasons. 0:40 As you develop your applications, you'll be working in a development, or dev, 0:45 environment, where you'll be fixing bugs and playing with new features. 0:49 A dev environment typically references a test database 0:54 which contains a mixture of test and production data. 0:57 Test data makes it easier to test specific scenarios within the application 1:01 while production data allows you to test the application 1:06 under conditions that closely mirror the production environment. 1:09 If your application connects to third party services, or 1:13 APIs, such as mail servers and human processors. 1:17 These services often have their own test environments or sandboxes where you can 1:21 make requests without impacting production or incurring additional expense. 1:26 Finally, the Dav environment most likely has additional debugging and 1:32 logging enabled to help developers quickly assess the situation. 1:37 When you push your application live for the world to see, 1:42 you'll be running you'll be running in a production or prod environment. 1:44 This is where users interact with your application for 1:49 entertainment, information or to purchase products. 1:52 We want to make sure that prod runs as quickly and smoothly as possible. 1:56 Development and production are the two most critical environments. 2:01 It doesn't matter if you're the only developer of the application, or 2:05 if you're working with a team of developers, 2:09 it's important that you are not making changes directly to production. 2:11 Many organizations implement additional environments, as well. 2:15 Although these vary by organization, 2:20 let's take a look at a high level overview of a typical workflow. 2:22 A new feature or a bug often referred to as an issue or 2:28 a task is assigned to a developer to implement or fix. 2:33 The developer uses their local development environment to resolve the issue or 2:38 complete the task. 2:42 Once the programmer has developed and tested their changes, they commit and 2:44 sync those changes to a version control system. 2:49 Those changes are then deployed to a shared environment known as Dev. 2:52 This makes it easy for anyone on the development team to review and 2:57 test changes often in conjunction with their own changes. 3:01 Remember, this environment often connects to its own development services and 3:06 data base. 3:11 Once the development team is satisfied that the changes are working properly, 3:13 the application is deployed to another shared environment 3:17 known as Quality Assurance, QA, or Testing. 3:20 Local dev environment is often only accessible 3:25 to members of the development team. 3:28 The test environment is typically accessible to 3:30 people outside of the development team, 3:33 [SOUND] such as QA testers, key users or business stakeholders. 3:36 The test environment's database typically contains a recent version of 3:41 the production data, 3:45 in order to simulate the production environment as closely as possible. 3:47 Test data may or may not be available depending on your specific situation. 3:52 Once everyone that is responsible for testing the application 3:58 in the test environment is satisfied that the changes are working properly. 4:01 The application is deployed to the production or prod environment. 4:06 The prod environment including all of the application code and 4:11 production database is typically backed up right before deployment is done. 4:15 This allows for the previous version of the application 4:20 to be quickly restored in case something goes wrong. 4:23 There are many variations of this workflow, but 4:27 most workflows have some semblance of the three environments, dev, testing and prod. 4:30 As a developer, we need to ensure that our code works effectively and 4:36 connects properly in each environment. 4:40 One common way of accomplishing this is through the use of environment variables. 4:43 Let's take a look at those in the next video. 4:48
You need to sign up for Treehouse in order to download course files.Sign up