• Servers and Tools

Processes: Introduction

From the class:  Processes

Hey, everybody. It's really good to be back. And over the next several classes, I'm going to talk about a really exciting topic called deployment. And that is, we're going to get an application running in a server that we've built out ourselves. So you might be wondering, why would we ever study how to do deployment when we have platforms as a service like Horoku or Meteor or any of the others?

And I've got a couple reasons for you. The first is that it will help you understand what it is that you're buying. So if you buy one of these services, you should know what features you're actually getting and whether or not it's cheaper to do it yourself rather than have someone do it for you.

The second reason is that as you build more sophisticated things, as an engineer, it's helpful to know what's required to run those things on the server. So understanding how much memory and how processes work and things like that will be useful to you I think over your career. And the third reason is that it's just cool and interesting. So it should spark your curiosity. How do these things actually run on the servers behind the scenes? So I think overall, this topic will make you a better engineer.

Now, I've drawn out a simple deployment diagram here where showed some of the different roles of a deployment that you're probably already familiar with. So up front we've got a web server, and that web server has any number of different programs that could be providing that role. So we've got nginx, httpd, haproxy. These are just software programs that provide an HTTP server. We'll get into them later on in other classes.

Then in the middle we've got an app server. We could be running Meteor, or we could be running Rails, or Express. Any one of the app servers. And finally in the back, we've got a database. So we could be using Mongo or Postgres MySQL, or any of the other document or relational databases.

And the common thing across all of these different software programs, regardless of what they are, is that they are all running something called a process on our machines. So the process is an executing piece of code that's running on our computer. So in this class, what we're going to do to start off this deployment topic is dive into what is a process.

I want you to have an intuitive sense for how they work, how to work with them, how to start them, stop them, their different properties, and so on, so when we get to installing different programs that run processes, you know what's going on. So let's get set up for the class quickly.

Like all the lessons on Evented Mind, if you scroll down and look at the Materials section, you'll see a couple handy links. One of them is the source code for the project. And so if you click on this, it'll take you to GitHub, and then you can clone the repository and use the same code that I'm using. You can also see some other handy links like transcripts if you need it and keyboard shortcuts if you want to navigate more quickly through the application.

And down below, I'm always grateful if you're able to share these lessons with your friends with Twitter, Facebook. It helps me to get new customers, which is always a good thing. And I'm also going to post some links to prerequisites down here in the body of the lesson. And so if you need help getting Vagrant set up for example, or if you want some more information on how to use the shell if you're not familiar with how to use it, you can go ahead and look at these prerequisites. I don't think you'll need them. You can go through the class without them. But just in case, I'm going to link to them it down here in the body.

The source code for this project is pretty simple for this class. It just has a Vagrant file which is going to help us configure our virtual machine. We're going to be using a virtual machine that's running Ubuntu, the latest version as of this class of Ubuntu. And the reason for using a virtual machine is that if you're running on Windows or Mac or any other operating system, this way we're all on the same page, we're all using the same machine.

So I'll type vagrant up. That will bring up the virtual machine, if it's not already running. And once it's running, we can type vagrant ssh and that will drop us into a shell inside of the virtual machine. Running the Wily version of Ubuntu operating system.

You can type exit to get back to your own terminal. And one thing to point out is any files that are here inside of this project folder are going to be automatically available to us in the virtual machine. So if I go back into the virtual machine ssh into it, and if I change into the forward slash vagrant directory, that's where these project files are going to be.

So this folder is automatically shared, and so I'm going to create some code files for example, and those will be available to me inside of this Vagrant folder automatically. That should be all we need to get set up. So let's get started.