DevQuestions with Tim Corey
I am Tim Corey. I teach coding online and my inbox is full of questions from current and future developers. I wish I could sit down with each of you and share the answers I know will help you go further, faster in the world of development. This podcast is the next best thing. On this podcast, I will answer the biggest questions people are asking! Send us to your suggestion for a future Dev Questions at https://suggestions.iamtimcorey.com/ To keep the podcast coming, like, subscribe, rate, and share it with your friends and colleagues. See why thousands of students have chosen to learn to think and code like a professional developer at www.DevForge.com.
DevQuestions with Tim Corey
113 What Is The Cloud? Do I Need To Know It? Is It Serverless?
Use Left/Right to seek, Home/End to jump to start or end. Hold shift to jump forward or backward.
What is the cloud? What do people mean when they say to put something in the cloud? Is the cloud just serverless? Is the cloud the same thing as a web host? Do I need to learn about one or more cloud providers? Should I learn Azure? AWS? Google Cloud? These are the questions we are going to answer in today's episode of Dev Questions.
Website: https://www.DevForge.com/
Ask Your Question: https://suggestions.iamtimcorey.com/
Sign Up to Get More Great Developer Content in Your Inbox: https://signup.iamtimcorey.com/
Welcome to the Dev Questions Podcast with Tim Corey. Join us each episode as we tackle the questions you are asking about a career in software development, understanding the industry, and new technology. If you're just starting out or you want to grow stronger as a developer, this is the place to get your questions answered. Now, here's your host, expert developer and online educator, Tim Corey.
SPEAKER_02What is the cloud? What do people mean when they say they're going to put something in the cloud? Is the cloud just serverless? Is it the same thing as any other web host? Is it just a fancy name? Do I need to know about it? And if I do, which cloud host do I need to learn? Azure, AWS, Google Cloud, or one of the others? These are the questions we're going to tackle in today's episode of DevQuestions. Now, if you have a question, you can go to suggestions.imtimcorey.com and look to see if someone's already asked that question. If so, upvote their question. And if not, ask your own question. Hopefully, others will upvote your question. You'll see on a future episode of DevQuestions. Now let's talk about what is the cloud, and then we'll get into do we need to know how to use the cloud? So, what is the cloud? The cloud is a network of computers or servers that are usually at a global scale or very very least a large scale. And they're off they usually offer interconnected services. So it's a bit different than a web host. It's not just one server somewhere that you have access to put stuff on. It's usually a network of computers that have a number of different services they offer. And usually it scales up to a more global reach. Now, that may answer a few of your questions, but let's keep going. Let's talk about serverless. Because you heard me say that it's a group of servers, and yet you probably heard the term serverless associated with the cloud. And you might say, well, Tim, the cloud is serverless. That means it has no servers, right? And the answer to that is no. That's not what serverless means. Serverless does not mean that you don't have a server somewhere. Instead, what it means is that your code does run on a server, but you don't have control of that server. Someone else manages it for you. That's really all it means. It means you don't have control, you give that control fully up to somebody else, and you just have the bit that runs your code. There's a little entry point or something where you can put your code and have it run for you. That's what serverless really is. So it does not mean a lack of physical servers, because everything runs on a computer somewhere. So, really, if you want to get down to the very basics of the cloud, it's somebody else's computer. That's what it is. Now, there's a lot more to it because not just a web host. And let's talk for a minute about web hosts because they are sometimes confused with the cloud. And sometimes people even try to price compare and say, well, this web host is offering me websites for $4.99 a month where the cloud charges me $8 a month. So it seems like web hosts are cheaper. Well, in some cases they can be. But let's talk about what a web host is. A web host is typically a company that offers a server where you can put your website. Maybe some other things like databases, but traditionally it's just a web server. And that web server is usually one machine. Maybe in bigger web hosts, you can get a cluster of machines, but usually it's not very many machines you have access to. Usually it's just one. And on that machine will be multiple websites. When I was working with one company, I was hosting on a web host. And I started to look at there's some weird configuration issues here. And so I started to kind of look at the behind the scenes and try and figure out what's going on. I found out that the web host was really just a company that had one big server, and they put 70 websites on that one server. And they misconfigured it. And when they misconfigured it, I got to see all 70 sites and all their data. Now, obviously, that's a big issue. And I contacted the company and made sure we got that cleared up. But that's what a web host is. Now, some web hosts can scale up better than that. They have multiple servers and backups and better security and all the rest. But really, what they it comes down to is you're running your site on one server. And the way you get that cheap deal is because the fact they're running multiple sites on that one computer. It's the economy of scale. The idea of if you wanted to host locally on a server, you'd have to buy an actual computer, a server, you'd have to have a dedicated internet connection that was always going to be up. You'd have to probably have a static IP address. You'd have to have good connection to the internet, you'd have to have a UPS system for backups and all the rest. And that's very expensive for one site. That's much more than the $4.99 a month hosting somewhere else. But if you said, hey, you know what? I could probably host 500 websites on this machine. Well, $500 times $5 a month is $2,500 per month to host that. You see how that could work out in your favor? For the most part, because once your server crashes, you take down 500 websites. That's a problem. So that's what a web host does is they have the resources, whether it's one server or multiple servers, whether it's just a part of a server for you, or if you have your site in a cluster of servers, whatever it is, it's usually a set number of servers that they then, through the economy of scale, give you a piece of in order for you to host your site. The cloud is different than that. Yes, at the very, very simplistic view of it, that's the same. In the fact that in the cloud, let's just take Microsoft Azure, for example, Microsoft Azure has massive data centers, which are just a whole bunch of servers. And then they give you a small piece of one of those servers to host your thing on. That's a similarity between that and the web host. But here's where the difference comes in. You see, in a cloud provider, they're not just hosting a few servers or even a few clusters of servers, they're hosting thousands of servers. And with that comes dedicated teams of people and dedicated space for those servers and dedicated protection for those servers and updates that are the same for all the servers, and maintenance, the same for all the servers, security that's the same for all the systems. So with that comes a next step higher in the economy of scale. So when it comes to the benefits of the cloud, that's the first one, is the economy of scale goes way beyond what you would see in a web host. Now you might say, but Tim, usually web hosts are cheaper to host a website. Well, yes, they are, usually, although if you work with Azure, you can get hosts a whole lot cheaper if you know how to do it right. But even if it was more expensive to go to, say, Azure or AWS, you've got to think about what you're getting for that money. You're getting some guaranteed uptimes. You're getting guaranteed backups, you're getting guaranteed multiple redundancies on the internet provider. You're getting guarantees on things like UPS or power, and you're getting guarantees on how what happens if the place burns down and how they can fall back to a different site, and a lot of other things that you don't necessarily get with a web host. So that's one thing. You get this economy of scale where really, if you were to try to buy all the things that a cloud provider provides for you for your one website or your one service, well, that would cost thousands of dollars. I've done that. I've hosted a whole network's worth of services on site. And it costs thousands of dollars every year to maintain. Because I have to pay for the servers, I have to pay for the redundant internet, I have to pay for new batteries for the UPS, I have to upgrade the sprinkler system, the halon system, I have to take care of the AC, and so many other things. You're paying for all that in your very small price tag. So that's one thing is that economy of scale, but it goes beyond just that one data server or data center. Because you can say, hey, I want my website hosted here, maybe East US, but I also want it to be redundant in the Western Europe. And that will take care of it for you. So now your website is not only hosted locally in one data center, it's also hosted in two different places that are hopefully close to your the majority of your audience. So now your audience gets your website faster because of the fact that they are closer to one of those data centers. So again, that economy of scale keeps allowing you to get bigger. Now, it's not just web hosting. And that's one of the things that when you look at the cloud, you cannot think just web hosting because there is so much more than that. You've got a lot of different options for web services that all tie together. So let's take, for instance, Azure. I love Azure, I play with Azure a lot. I host my services and systems in Azure. So I have MongoDB hosted in Azure. I have my SQL, I have multiple SQL servers hosted in Azure. I have web servers, I have Azure functions, I have virtual machines, I have a lot of different things hosted in Azure. And those services all tie together: storage and events and all the rest. They all tie together in one cohesive system so that I can say, I'm gonna give this website permission to talk to this database without a password. Because they're both hosted in Azure. I can say this service with this ID has access to SQL Server when no one else does. No passwords involved, it's just authorizing an application. Well, that's more secure. And I have that option because they're in the cloud. So that's benefit number two. Benefit number three is your reach. So let's say you decide to put your data into a Cosmos DB database. And Cosmos DB is world scale, meaning you can have a replica of your database in just about every location on the globe. You can put it in multiple different data centers and allow people to access the one that's closest to them. Not only for read access, you can also have write access to databases in multiple spots across the globe. Well, that cuts down on things like latency. So if in the US, I wanted to talk to a web server or a database that was in Australia, which is about halfway around the globe, that the speed of light comes into effect. I'm gonna have latency. I'm gonna have a lag time because of the fact that light has to go halfway around the world and come back. So if I have a database that is located in my location, then I don't have to worry about that lag time when I'm talking to the database. And yes, there is some synchronization, lag time, and things to think about, but that's the database handling it rather than the customer seeing it. So there's a lot of economy of scale, but also a better reach for your application. Fourth, we have better security. So the cloud, think of the cloud like a bank. So when you put your money in your mattress, well, you're protecting it. And you're responsible. So you lock your doors at night and you set an alarm if you have an alarm system and then you keep a baseball bat by your bed to fend off thieves, that's your protection system and it's all on you. But if you take your money and take it to the bank, there are a number of safeguards in place to protect your money. It's the same thing with your applications. If you put your application on site, well, you're the one that has to make sure that all your servers are patched. You're the one that has to make sure that all security fixes are applied. You're the one that has to make sure that all of your servers are configured correctly so they don't have a vulnerability or an open port. You're the one that has to have the right firewall in place or the right rules. You're the one that has to make sure that your the physical access to your servers is not uh easy to do and that you can track anybody that does have physical access. You see, the list goes on of all the things that you have to do. It may feel like, well, yeah, but but I control it all. And you know, there's no corporate entity looking at my data. Well, there's not with Microsoft either, but that's beside the point. So if you try and do it yourself, you're kind of like you're putting money in the mattress and saying, yes, but I control all locks of my house. When you take your money to the bank, you have a bank vault and you have you have tellers that verify the the money going in and put that transaction into a system that is centrally backed up, and you have the protection of the FDIC for your money in case anything gets happens and all the rest. So even if a person robs the bank, they don't take your money specifically. That's the same thing with going to the cloud. When you put your data in the cloud, you have very little to do with the security of your data. That's taken care of by teams of people who are dedicated to the security of your data. When it comes to physical security, when it comes to environmental security, things like fire, flood, hurricane, tornado, and all the rest, whether it is securing it from internal employees, making sure they have card access or retinal scans or whatever they need to, um, or whether it's you know data breaches, firewalls, and all the rest, the protection is done by teams of people. So it's like putting your data in a vault. So cloud access is actually in almost every case more secure versus your on-site data. All right. So that's number four. Number five, beta redundancy. So let's say you have your data in one central server, whether it be a web host or whether it is on your own on-site. Well, what happens if it's a tornado? How do you get your website back up? Because your website's going down. I mean, the the web server is down because the web server is now in Kansas. So how do you get your website back up? Well, hopefully you have backups, right? But where do you put those backups? How do you get those backups? How long does it take? Whereas if you're hosted with a cloud provider, you can have, first of all, a cloud provider is very good about uptime. Their uptimes are very, very high. And yes, you'll hear about downtimes and oh my goodness, this downtime happened, it was horrible. And yeah, that happens once in a while. It happens with everything. However, if you host in more than one location, if it's really important to you, you can host in more than one location. Where if this one's down, no problem, that one's up. And if it's not quite that important, you could have a passive fallback where, okay, that one's down. Let's bring this one up over here and spool up these servers with a script that we already use for the production. So it takes a matter of an hour or two or less to get your backup site up and running. There's ways to have redundancy depending on how much cost you want to put into it. So there is better redundancy for your data, for your applications, for your websites. And six, just better management. I've maintained servers. I have maintained servers in production for businesses and universities. And I tell you what, it's a pain because you have to always be on top of every operating system you have, knowing which patches are out, what they do, trying them out, testing them, verifying they work, implementing them, and doing so sometimes in the same day because of the level of severity of a certain issue. You don't have to do that with the cloud. It's taken care of for you. Unless you were to create a virtual machine in the cloud, which I don't usually recommend for most circumstances. But a virtual machine in the cloud, you control the operating system, in which case you're responsible for the operating system. But if you just host your website, or even better yet, use serverless, well, then that's all taken care of by the cloud provider. That means that their team of experts spends time figuring out which patches to apply, how to apply them, testing them, and then actually implementing those round the clock. They take care of it for you. You don't have to do it for yourself. So there's lots of benefits to the cloud. There's lots of benefits to knowing about the cloud as a developer because of the fact that the cloud can almost certainly save most businesses money, whether it is by actually just being cheaper than hosting your own servers, or whether it is by adding layers of security that you can't afford otherwise. So there's a lot of benefits to the cloud, but a lot of benefits as a developer for knowing the cloud. So do you need internal cloud? Yes. I highly encourage you to. I encourage you at least know one. Know one so that even if your business doesn't use the cloud yet, you can say, hey, have we thought about? Hey, can we try this? Hey, can I show you how this might work? Maybe it's as simple as if you have a SQL Server. SQL Server is very expensive to host locally, very expensive. And it's hard to do well with replication because it's even more expensive and it's tricky to configure. But did you know you can host an Azure SQL instance that synchronizes with your local SQL instance? So you can have your Azure SQL instance just be a backup. And then if anything were to happen, let's say your SQL Server locally blows up, you can just change your connection strings to point to the Azure SQL instance and be back up and running in minutes. So just that little thing can offer you the step into the cloud. And then next you could say, hey, you know what, boss, this has been going great. We have both of these going. Let's just try switching the two. Now you rely on the Azure SQL instance, and the local SQL instance is the backup. Maybe that works right for your instance, maybe it doesn't. But if it does, that gives you another step into improving your availability, improving your scalability, and improving your reach. Now instead of having to be local in order to talk to the local database, you can be on the road and talk to the database because it's all cloud-based. So there's lots of ways you can go about moving from where you are, which is no cloud, to a little bit of cloud, to a little bit more cloud until you can take it full advantage of all the benefits of the cloud. So knowing at least one cloud can be very, very beneficial because if you can start to introduce benefits to your employer, reduced prices, and improve features, then you become the hero. You become the person who saves your business or who move your business forward. I remember working at a company where we were spending over $2,000 a month on web hosting. We took all those services because they were redundant and all the rest. We took all those services and moved them to Azure. We increased availability, we increased throughput, we increased our scalability, we increased our security, and we reduced our bill by 75%. That makes you look like the hero. That makes your boss go, man, you did a great job because you knew the cloud. So I encourage you, learn at least one cloud. The question may come up: do I need to know multiple clouds? Probably not. Um, no, I wouldn't say so. Yes, if you're gonna switch jobs and they need to they change clouds from what you were doing, sure, you can learn the other cloud, but don't expect to use multiple clouds at once. Um, don't do the multi-cloud setup thing. That's that's a recipe for disaster. Um, that's not an improvement, that's actually a step backwards usually. So focus on one cloud. And if your business uses a particular cloud, learn that one. And if you decide you want to go into a different business and they use a different cloud, well, then pick up the other one. All right. I hope they answered your question. Thanks for listening, and as always, I am Tim Corey.
SPEAKER_01Thank you for joining us for this episode of Def Questions. Tim is committed to making it easier for you to become a developer. If you would like to help make more content like this possible, please like, subscribe, rate, and share Def Questions. You can also send your questions to questions at IamTimcorey.com. Until next time, remember, you are too smart and your time too valuable to waste it making all the mistakes Tim did. When you're ready to learn to think and code like a professional developer, head over to imtimcore.com and enroll in a course.