RESTful and HTTP APIs in Pyramid Transcripts
Chapter: Deploying your REST service to DigitalOcean on Ubuntu
Lecture: DigitalOcean overview
0:01 Here we are on Digital Ocean,
0:04 you've maybe heard of Digital Ocean,
0:06 I am a huge fan of what those guys are doing,
0:08 you probably heard of things like aws and azure,
0:11 but I'm here to tell you for simpler, not extremely complicated web applications
0:17 that have to dig into all of these cloud apis, this is a better place to be;
0:22 it really is better performance and much, much cheaper, and really just simpler.
0:26 We're going to use Digital Ocean to go create this Linux server.
0:29 Now, let's click really quickly on pricing,
0:32 just so you guys see like what it is we're going to create,
0:34 so the pricing is really nice here, we're going to use a standard droplet
0:38 and pay, we can get hourly price if we want,
0:41 but really monthly is a better human term to think about what is it going to cost us,
0:45 they also have like high memory ones, and whatnot,
0:48 but we're just going to focus down on these standard ones.
0:51 So we're going to use a five dollar server,
0:53 and you'll see that this five dollar server
0:55 will run our api for many, many requests, I'm pretty sure
0:58 we could get millions of requests per month for five dollars.
1:01 And just to indicate like what a good deal this is, last time I checked the pricing
1:06 for just bandwidth alone at aws was nine cents per gigabyte,
1:11 notice you get a terabyte of bandwidth here,
1:14 so 0.09 times that many gigabytes, that's 92 dollars a month
1:18 just in bandwidth value that you get with his thing,
1:21 not to mention you get ssds and all sorts of goodies.
1:24 So what we're going to do is we're going to go create one of these,
1:27 now, I have already created an account, so logged in here
1:30 you can see my various servers that I used to run the Talk Python and Python Bytes stuff
1:35 and we're going to go and create a new droplet,
1:38 so let's go down here and and show you what you get
1:42 so we can come down, we can pick a variety of different linux distributions,
1:45 and pick different versions as well, so let's just go with this one,
1:51 the standard long term support Ubuntu, there's not a real great reason
1:56 to choose a different one, I will just point out though that you can go
1:58 if you want to and get it kind of pre configured, like from my Mongodb server
2:02 I just went down here and said I want Mongodb running on that version of Ubuntu
2:06 and boom, it already comes preconfigured, somewhat secure, things like that.
2:10 But we're not using Mongo, so we'll use this
2:13 and pick this size, you'll see that that's plenty good
2:18 we don't need block storage right now
2:21 we could get a different data center so I'm on the west coast of the US
2:25 so I'll pick something in San Francisco
2:27 and then we just have to create an ssh key, we click go, give it a name,
2:31 and let's call this auto service server something like that
2:37 it seems like a decent name, we can have a bunch,
2:40 I don't want a bunch, I want one, and we'll get going.
2:42 So, that's how it will work, we're going to need to do things like create an ssh key,
2:46 so that we can log in and not have to worry about passwords, and things like that,
2:50 but we'll do that in just a moment, right.
2:53 So Digital Ocean basically lets us create these servers
2:56 and then we can go over to the networking section which we'll do afterwards
3:00 and we can basically get it's called a floating ip address,
3:04 and what that means is there an ip address that kind of
3:07 we control independent of the machine and we can map our domain to that
3:10 and then we can do things like hey I need to upgrade the server
3:13 I could move it over to a temporary fail over server if for some reason
3:17 I want to just create a new version after six months
3:20 on a new implementation of Linux or whatever
3:23 I could spin that up and get it exactly ready
3:25 and then I could just instantly flip the switch, and it will flip to that new server.
3:28 So it gives you a little bit of machine independence,
3:31 with this networking section, so we're going to do that next,
3:34 but first, in order to create this, we're going to create an ssh key.