Heads up! To view this whole video, sign in with your Courses Plus account or enroll in your free 7-day trial. Sign In Enroll
Preview
Start a free Courses trial
to watch this video
In this episode, we talk with Scott Hanselman about the (often incorrect) assumptions that are made when developing and deploying web applications to the cloud.
Services and Products
Definitions
- Data Center
- Colocation
- FTP (File Transfer Protocol)
- Multitier Architecture
- Server Farm
- Scalability
- Micro Services
- Containers
- PaaS (Platform as a Service)
Learning
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
Welcome to the Dev Team Show.
0:00
My name is James.
0:01
In this episode,
we're gonna talk about cloud assumptions.
0:02
Joining me is Scott Hanselman.
0:06
Welcome to the show, Scott.
0:08
>> How is it going?
0:09
[MUSIC]
0:10
I'm very familiar with
deploying a website,
0:14
hosting a website on a local server,
pretty straightforward stuff.
0:17
Even like I would describe
as commodity hosting.
0:22
Where I'd go buy some cheap hosting
service, maybe that's $10 a month, right?
0:25
Deploy up there, very simple.
0:29
I can add a site, configure that site,
0:31
deploy my site up there,
pretty simple stuff.
0:33
Very similar to what I did locally but
cloud.
0:36
I created an Azure account, and now,
I just kinda repeat and do the same thing.
0:40
Am I doing something wrong?
0:44
Am I missing kind of the point of
why I would even be interested in
0:46
doing stuff up on Azure and
doing cloud development?
0:50
>> Okay, so the word cloud is one
of those words like containers,
0:55
where it's like it's fun to say,
it feels good in your mouth.
0:58
Cloud, cloud, but, what does that mean?
1:01
Is cloud's what like younger
people call hosting?
1:04
It's more than that.
1:07
I like to think about it in terms of
what is virtual, and what is physical?
1:09
And what is elastic, and what is not?
1:12
So if I made a website on a machine or
a Virtual Machine,
1:14
and I put it on a host, lower case h,
or upper case H, it doesn't matter.
1:18
Some local inexpensive host,
I could visit my computer.
1:23
I could go down, I could drive down to
that host, and I could find that machine,
1:28
and I could say, show me my C drive,
or show me my mount point.
1:31
Where's my site?
1:35
Well, it's on this spinning rushed
1:37
disc on this rack in this room
with a wire that goes to the wall.
1:40
That's your computer.
1:44
That is hosting.
1:46
Sometimes in the old days,
1:47
you used to actually physically
take your computer down there.
1:48
And you would literally be
buying a slot in the rack.
1:51
>> Co-locating, yeah.
1:53
>> You would co-locate, right?
1:54
Then it got to the point
where you just FTP your code,
1:56
you'd send your code up there.
1:59
But when you move into the cloud,
if you treat the cloud as a host,
2:01
as a simple host, that is a rather naive.
2:06
And that's not meant to be a diminutive,
it's just simply to be a descriptive word.
2:09
It's a naive way to think about hosting.
2:12
You can take a Virtual Machine,
and do what's called lift and
2:14
shift, and move that into the cloud,
and you go look, we're into the cloud.
2:17
When I move something over in the cloud
though, and I treat the cloud as a host,
2:21
I'm missing out on the fact
that it can be elastic.
2:25
It can scale in different directions, and
2:28
I'm also fooling myself in
thinking I can visit it, okay?
2:30
We've gone into an entirely
virtual world right now, okay?
2:34
So let's think about classic
three tier architecture.
2:38
This was when a website, and a shopping
cart, and a product catalog would
2:40
sit on top of some business objects that
would then sit on top of a database.
2:45
>> Right.
>> Again,
2:48
you could visit them all and
you could go and put them somewhere.
2:49
And if someone were gonna upload
information to that particular
2:51
application, maybe product images,
you take those images and
2:54
then you put them on the disk, right?
2:58
And then what happens if there's
now two web servers in that,
3:01
there's now a web farm?
3:04
Well, if I go and hit it,
I'm gonna hit www1, and
3:06
then ww2, and I'll bounce back and forth.
3:08
Each time I upload my images,
they might show up on a different disk.
3:12
So now, I have some scale problems, and
I have an issue with what's called node
3:16
affinity, where I have an affinity with
one node and that's where all of my thing
3:20
get uploaded to, and I have affinity with
this node it gets uploaded to there.
3:24
So then I might make a shared disc,
right, and then have a mapped drive.
3:27
But now, I've got three things,
I've got two Virtual Machines and a disc.
3:32
Then I think, we'll maybe I'll
put the files in the database.
3:35
Well, is that really where they belong.
3:38
Suddenly, you start getting into
interesting problems of scale.
3:39
You can ask yourself,
do I scale out more computers?
3:43
Or do I scale up, bigger,
fancier computers?
3:47
If I simply move over into the cloud, and
then try to solve those problems in those
3:50
ways, suddenly,
I'm not really doing product catalog and
3:55
a shopping application anymore,
now I'm doing kind of aministrivia.
3:59
Just administrative moving
around of Virtual Machines.
4:03
It's the same problem I had before,
except instead of moving
4:05
around physical machines,
I'm moving around Virtual Machines.
4:08
What you wanna do is when you move over
to the cloud, do your lift and shift.
4:11
It's okay to do that.
4:14
But then also think to yourself, how
can I make my application cloud native?
4:15
So a cloud native application
doesn't write to the disk, right?
4:21
It writes to some cloud based storage,
whether it be Amazon S3, or
4:25
Azure storage, or some Mongo database
out there in the world, or SQL Server.
4:29
Some mutable storage that is
available to me via an API.
4:34
Someone goes and uploads an image, I never
write to my local disk, I send it off into
4:40
Azure Document DB, or some where, or S3,
or whatever, it's nondenominational.
4:45
These concepts are not specific
to Microsoft Azure, or
4:50
Google Cloud, or Amazon.
4:52
These are, how to architect for the cloud.
4:55
Then I might wanna ask myself, well,
how does this web server talk to these
4:57
business objects that then
talk to the database?
5:01
>> Right, if I'm doing development
locally, how does that change that, right?
5:03
I mean you're talking about
not touching the disk anymore.
5:07
Do I just abstract that away, and
5:09
I am actually touching the disk
when I'm developing locally?
5:11
Or is there some way of
emulating that service locally?
5:14
>> It all depends on
what you decide to chose.
5:16
So, for example, if it's Mongo, and
that's gonna be your object store.
5:18
Then you're gonna run
an instance of Mongo locally.
5:21
And then you can have one in the cloud,
or use a third party like MLabs.
5:23
If you're doing something
like Azure DocumentDB,
5:27
which is kind of like a JSON
based document store.
5:29
You could have a local
DocumentDB emulator.
5:33
If you're gonna talk to storage,
Azure Storage or S3,
5:36
there's an Azure Storage Emulator.
5:39
So you can simulate your
own internal Cloud.
5:41
But then you have to start
thinking about decoupling.
5:45
Is the product catalog that receives these
new product images going to just talk
5:47
directly to that?
5:52
Or is there gonna be an intermediary?
5:53
>> Right.
5:54
>> Then you wanna ask yourself,
when parts of my site go down,
5:55
does it make the entire site go down,
right?
5:58
Netflix is really great where if parts of
Netflix goes down like adding a DVD to
6:01
your cart or searching for a movie,
that doesn't make the movie stop playing,
6:06
like Netflix doesn't entirely go down.
6:11
One of the microservices
within Netflix goes down.
6:13
So if I have a single virtual machine and
it falls over my product catalog is gone,
6:15
my shopping cart is gone.
6:20
But if I had a shopping cart service,
and an identity service, and
6:22
a checkout service, and taking money
from the customer service, and
6:27
a product catalog service.
6:30
Can I architect my application
where they are loosely coupled?
6:31
So that any one of those could go down,
and the site wouldn't fall over.
6:34
>> Or you could even scale those
independently of each other, right?
6:37
>> Exactly, exactly.
6:40
And then that allows you to then
containerized those in the future.
6:41
So there's levels of increasing maturity.
6:45
Lift and shift is fine, but
you don't wanna stick with that.
6:47
Start breaking things up into different
Virtual Machines or Platform as a Service.
6:50
Platform as a Service is like
where an Azure app service, or
6:55
an Azure website, sits on top of
a Virtual Machine that I chose to ignore.
6:59
I know it exists, but
I pretend that it doesn't exist.
7:04
Like at Heroku, or Google Cloud,
they all have Virtual Machines, but
7:07
they hide them from us effectively.
7:11
So if you ask yourself as you decide to
move your application into the cloud,
7:14
do I want to know, care, and
love my Virtual Machines?
7:18
>> [LAUGH]
>> Or
7:21
do I really just wanna borrow them,
and not really think about them?
7:22
It's almost like pets for hire,
like you can get a dog, but
7:26
you gotta keep it watered,
and fed, and all that.
7:29
I don't have a dog, so I don't know
how you have to water the dog.
7:30
But you know what I mean?
Or
7:34
I can just borrow my brother's dog,
and then I have a dog for hire, right?
7:34
So Virtual Machines are not
necessarily a business I wanna be in.
7:38
The cloud has the ability to
programmatically change to elastically
7:43
grow both horizontally, or scale out more
Virtual Machines or up, make them bigger.
7:48
None of that is the same as a host
where you can visit your hard drive.
7:54
>> Yeah.
7:58
So, if we start with the lifting and
shift, Ship or shift?
7:59
>> Shift.
>> Shift.
8:03
>> Lift a virtual machine and
shift it to the cloud.
8:04
>> Right.
8:07
So, if you start with that,
is there like a common path forward?
8:07
You pick some part of your application,
say, we're gonna turn this into a service?
8:11
>> So if it's a web application,
you wanna ask yourself,
8:15
can I pick it up off the Virtual Machine,
and put the web component,
8:18
the page serving component, whether
it's a node, or ASP.NET, or whatever.
8:22
Can I move that into a PaaS, or
Platform as a Service, environment?
8:27
If I was picking up a blog that runs
on a Virtual Machine, could I run that
8:32
in Azure App Service, or in Google Cloud,
or in Amazon Lambda, or somewhere else?
8:36
>> You might leave the database behind.
8:40
>> And then later on,
could I move the database somewhere else?
8:43
Then I could say, well,
using the product catalog example,
8:45
could I somehow tease the product
catalog and shopping cart separate?
8:48
>> Right.
>> And have shopping cart dot my website
8:52
dot com?
8:55
>> So instead of thinking of these
horizontal layers in your application,
8:55
you started thinking in vertical slices.
8:59
And think, well, maybe products.
9:02
>> In functional slices, yeah, exactly.
9:03
>> Cool [LAUGH].
9:06
>> That's a way that I
think about the cloud.
9:09
And I think that if you go out and explore
those concepts, you'll be able to apply
9:10
them to your own applications as
you explore your learning here.
9:14
>> All right, well, great.
9:16
Thanks for sharing that, Scott.
9:17
>> Thank you.
9:18
>> Be sure to check the notes
that accompany this video for
9:19
links to additional resources.
9:21
Also, rate this video,
let us know how we're doing.
9:23
Or if you have a topic that you'd like
to see us talk about in the future,
9:25
tell us about that too.
9:28
See you next time.
9:30
[MUSIC]
9:31
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up