Containers and Virtualisation in Cloud Computing ☁️

Gaurav Sen
27 Nov 202008:00

Summary

TLDRThis script delves into the evolution of virtualization and containers in software engineering, highlighting their significance in cloud computing. It explores the shift from physical hardware to virtual machines and then to containers, emphasizing the benefits of resource isolation, platform independence, and flexibility. The script also touches on the challenges, such as boot times and management overhead, while comparing the impact of containers to Java's influence on programming languages.

Takeaways

  • 💡 Virtualization and containers are significant in software engineering, especially with the rise of cloud computing.
  • 🛒 Traditionally, capacity planning involved guessing resource needs and led to physical hardware purchases, which could be costly and inflexible.
  • 🔄 The risk of scaling business required buying larger computers initially to avoid repeated investments, but this meant higher upfront costs.
  • 🏢 Organizations tried sharing single computers among employees, leading to resource contention and the need for better isolation.
  • 🖥️ The operating system acts as a manager of resources, allocating memory, IO, processing, and disk to programs while preventing interference between them.
  • 🌐 Virtual machines provide a strong boundary for applications, acting as a separate operating system on top of the host OS, offering isolation and flexibility.
  • 🌍 Cloud computing enabled by virtual machines allows companies like Amazon and Google to rent out their spare hardware resources to businesses.
  • 💻 Platform independence is a game-changer, allowing code to run on different OS without modification, similar to Java's 'write once, run anywhere' philosophy.
  • 🚀 Containers offer lightweight virtualization for app isolation, booting faster than VMs and requiring less overhead for resource management.
  • 🔧 Docker and similar technologies have simplified the process for developers to specify their resource and OS needs without worrying about the underlying hardware.
  • 🚧 While containers have many advantages, they may introduce some slowness and potential security issues, and might be overkill for very simple applications.

Q & A

  • What is the primary reason for the focus on virtualization and containers in the software engineering field?

    -The primary reason is the significant role they play in cloud computing, allowing for more efficient resource management and scalability.

  • What is capacity planning in the context of software deployment?

    -Capacity planning is the process of estimating the amount of computational resources, such as memory, storage, and processing power, that an application will require.

  • Why is buying a small computer problematic for a business that expects to scale?

    -A small computer may not have enough resources to handle increased demand, leading to the need for additional investments in hardware as the business grows.

  • What is the main advantage of using a large computer for business operations?

    -A large computer can accommodate growth, reducing the need for repeated hardware purchases and associated costs as the business scales.

  • How does resource contention occur when multiple people use the same computer?

    -Resource contention occurs when different users or applications compete for the same limited resources, potentially leading to performance issues.

  • What is the role of the operating system in managing resources for multiple programs?

    -The operating system acts as the manager of resources, allocating memory, IO, processing, and disk space to different programs while ensuring they do not interfere with each other.

  • What is a virtual machine and how does it provide a stronger boundary for resource management?

    -A virtual machine is a software emulation of an actual computer, providing a strong boundary by running on top of a host operating system and isolating the resources allocated to it from other virtual machines.

  • How does the concept of virtual machines enable the business model of cloud computing?

    -Virtual machines allow large companies to utilize their spare hardware resources and rent them out to smaller businesses, offering scalable and cost-effective computing solutions without the need for large upfront investments.

  • What is the significance of platform independence in the context of virtual machines and cloud computing?

    -Platform independence means that applications can run on different operating systems without modification, providing flexibility and reducing dependencies on specific hardware or software environments.

  • What are the key differences between virtual machines and containers in terms of resource usage and isolation?

    -While virtual machines provide full OS-level isolation with each instance having its own operating system, containers offer a lightweight form of virtualization that shares the host OS kernel but isolates applications at the process level.

  • What are some of the potential disadvantages of using containers compared to virtual machines?

    -Containers may have slower boot times, potential firewall issues, and the overhead of container management might not be justified for simple applications where the benefits of containers are not required.

Outlines

00:00

💡 Introduction to Virtualization and Containers

The script begins by introducing the significance of virtualization and containers in software engineering, particularly in cloud computing. It explains the historical process of capacity planning where developers would guess the resources needed for their applications and purchase hardware accordingly. The narrative then moves to the challenges of scaling and the high initial investment in hardware. The concept of virtual machines is introduced as a solution to resource isolation, allowing for the development of cloud computing business models where large companies like Amazon and Google rent out their spare hardware to smaller businesses. The script also touches on the benefits of virtual machines, such as platform independence, flexibility, and dynamic resource provisioning.

05:04

🚀 The Evolution to Containers and Their Advantages

This paragraph delves into the evolution from virtual machines to containers, highlighting the need for a more efficient and lightweight form of virtualization. It discusses the drawbacks of virtual machines, such as the time it takes to boot them up and the desire to avoid starting an entire VM when only specific resources are needed. The paragraph introduces containers as a solution that provides application isolation without the full overhead of a VM. It explains how containers work, including the process of mounting and unmounting, and how technologies like Docker have simplified the process for developers. The script also mentions the benefits of using containers, such as faster boot times and developer control over resources, while acknowledging potential disadvantages like slower performance and firewall issues for some applications.

Mindmap

Keywords

💡Virtualization

Virtualization refers to the creation of a virtual version of something, such as a virtual machine (VM) that behaves like a real computer with its own operating system and resources. In the context of the video, virtualization is a key technology that enables cloud computing by allowing multiple VMs to run on a single physical server, thereby optimizing resource use and reducing the need for physical hardware.

💡Containers

Containers are a form of operating system virtualization that allows applications to run in isolated environments with their own dependencies. They are lightweight compared to virtual machines and provide a way to package applications along with their libraries and dependencies. The video discusses containers as a modern approach to application isolation that is more efficient than traditional VMs.

💡DevOps

DevOps is a set of practices that combines software development (Dev) and IT operations (Ops) to shorten the systems development life cycle and provide continuous delivery of value to end users. In the video, DevOps is mentioned in the context of capacity planning, where DevOps teams would traditionally be involved in deciding the hardware requirements for running new code.

💡Capacity Planning

Capacity planning is the process of estimating the amount of computing resources needed to meet the demands of a growing business. It involves making educated guesses about future requirements for memory, processing power, and storage. The script describes how this traditional approach can be inefficient and costly due to the need for physical hardware purchases.

💡Cloud Computing

Cloud computing is the delivery of computing services, including servers, storage, databases, and software, over the internet ('the cloud') to offer faster innovation, flexible resources, and economies of scale. The video explains how virtualization enables the business model of cloud computing, allowing companies like Amazon and Google to rent out their spare computing resources to others.

💡Platform Independence

Platform independence refers to the ability of a software application to run on multiple operating systems or hardware platforms without modification. The video highlights this as a significant advantage of virtual machines and containers, as they allow applications to run in environments that differ from the underlying host system.

💡Hypervisor

A hypervisor is a piece of software, firmware, or hardware that creates and manages virtual machines. It provides a layer between the virtual machines and the physical hardware, allowing multiple VMs to run on a single host system. The script mentions the hypervisor in the context of virtual machines running on top of an operating system.

💡Resource Isolation

Resource isolation is the practice of separating the resources used by different applications or processes to prevent interference and ensure that one application's actions do not affect another. The video discusses the importance of resource isolation in virtualization and containerization to ensure that applications run smoothly without impacting each other.

💡Docker

Docker is an open-source platform that automates the deployment of applications inside containers. It uses the Linux kernel's features to isolate processes and allows developers to package applications and their dependencies into a portable container. The video script positions Docker as a key technology that simplifies container management and application deployment.

💡Mounting

In the context of the video, mounting refers to the process of making a filesystem available for use in a container. This is analogous to mounting a physical disk, where the container's filesystem is prepared and made accessible to the application. The script explains that mounting is part of the process of setting up a container's environment.

💡Overhead

Overhead in computing refers to the additional resources or time required to perform a task beyond the resources or time used for the task itself. The video mentions that while containers offer many benefits, there can be overhead associated with container management, which may not be justified for simple applications.

Highlights

Virtualization and containers are key topics in software engineering, particularly for cloud computing.

Traditionally, capacity planning involved guessing resource needs for applications, leading to potential over or under investment in hardware.

The challenge of scaling business with hardware limitations and the need for a more flexible approach.

The concept of resource isolation to prevent contention between multiple users on the same hardware.

Operating systems as managers of resources, with programs interfacing to request memory, IO, and other necessities.

The problem of shared compute resources and the need for stronger boundaries to prevent interference.

Virtual machines as a solution, acting as an operating system on top of another, providing a strong boundary for applications.

The emergence of cloud computing, enabled by virtual machines, allowing companies to rent out spare hardware.

The benefits of platform independence in cloud computing, similar to Java's impact on programming languages.

The flexibility of virtual machines in terms of provisioning resources dynamically, as opposed to the static nature of physical hardware.

The introduction of lightweight OSes as a precursor to containers, offering a faster alternative to full virtual machines.

Containers as a form of virtualization that provides app isolation without the full OS isolation of virtual machines.

The process of mounting and unmounting in containers, analogous to accessing the contents of a physical disc.

Technologies like Docker simplifying the process for developers to specify their resource and OS needs.

The advantages of using containers, including faster boot times and less hardware dependency.

The potential disadvantages of containers, such as slower performance compared to native applications and potential firewall issues.

The consideration of container management overhead and its suitability for simple applications.

Transcripts

play00:00

We will now talk about virtualization and containers,

play00:02

which has become a very important topic in the software engineering field,

play00:06

primarily because there's a lot of focus on it when it comes to cloud computing.

play00:11

But where do these ideas come from?

play00:24

Initially what used to happen is, when you used to write code,

play00:28

you would have a DevOps team or a finance team,

play00:31

which would ask you which box do you want to buy for this code?

play00:35

So you would do something called capacity planning,

play00:38

which is basically a bunch of guesses. We have a video on this.

play00:43

You make a bunch of guesses and you tell that this is the amount of compute I

play00:46

need. This is the kind of memory I'll be requiring for this application.

play00:49

I'll be needing this much storage.

play00:54

Finally, you go to the shop and you buy a computer. Now this is an investment,

play00:57

of course. You're buying a computer.

play01:03

If you buy a small computer,

play01:05

the problem is "What if your business scales?" So you went to the shop,

play01:09

you bought the computer, you made all that time and effort investment,

play01:13

and then what? Your business scaled. And you need to do this all over again.

play01:17

So what you want to do is: you don't want to buy a small computer.

play01:19

Because that investment doesn't make sense.

play01:21

You want to buy a large computer or a reasonably safe computer so that you don't

play01:26

need to do this again and again.

play01:28

But the problem with this is that the initial hardware investment is very large.

play01:33

If you want it to horizontally scale, just on the basis of hardware,

play01:36

you would need to buy as many computers as possible.

play01:48

So one of the approaches that organizations took was to let their employees use

play01:51

that single computer. But if you have multiple people using the same resource,

play01:59

there's going to be some contention.

play02:01

So you want to isolate resource usage as much as possible. The question was,

play02:05

can we do this for applications?

play02:09

Now let's get to the technical details.

play02:11

You have a program which requires a number of resources,

play02:14

which is usually memory IO, processing, and disk.

play02:17

So that's how you can think of your computer also.

play02:19

It's a bunch of these four resources which can be used for running your

play02:23

program. Obviously, the more programs you have, the more resources you need,

play02:28

but you also want to do some sort of boundary management,

play02:31

which means that A does not interfere with B's memory.

play02:34

And C does not interfere with A's IO.

play02:37

And that responsibility is going to be taken up by the operating system.

play02:42

So now the operating system is the sole manager of these resources.

play02:45

When you write a program, you talk to the operating system, saying that:

play02:49

through your interface, I'd like to book X amount of memory,

play02:52

Y amount of IO and so on.

play02:53

So you're seeing that this pink program over here with the interface,

play02:56

is taking up some of the space in terms of resources. Similarly,

play03:01

you can have multiple programs which are going to be taking up slices of the

play03:04

resources that the operating system can provide.

play03:06

And the remaining is going to be unused.

play03:10

The problem with this is that you can still have the same problems of shared

play03:12

compute, where if the memory runs out,

play03:15

because let's say yellow takes up all the memory, then everyone else is upset.

play03:19

What we would prefer to have is something like a very strong boundary,

play03:23

which is provided by something called virtual machines.

play03:27

And this concept is super interesting because the virtual machine is like an

play03:30

operating system in itself.

play03:32

So it's an operating system running on top of an operating system.

play03:36

Technically you can have the blue box over here as a hypervisor,

play03:40

but let's assume that it's operating system and you're running this on top of

play03:43

it. So it's like the matrix effect. The real world is being hidden from you.

play03:46

And you can interact with this fake world that you have without concerning

play03:51

yourself of what other programs are running in the same hardware.

play03:54

You're now merely concerned with the virtual machine that you have been

play03:57

assigned, which has been given a set of resources.

play04:00

This concept makes a new business model possible,

play04:03

which is called cloud computing.

play04:06

The basic idea is huge companies like Amazon and Google have a lot of hardware

play04:10

lying about.

play04:10

What they can do is take all of the spare hardware and rent it out to small

play04:14

businesses. For example, InterviewReady.

play04:17

I can go to Google or Amazon and say that, "Hey, please run my site.

play04:21

I'm going to pay you some rent money,

play04:23

but I'm not going to be making that big investment of maintenance and upfront

play04:27

cost of buying a computer. Like where am I going to place it?" So that is,

play04:30

the rent cost of placing the computer, of maintaining that computer,

play04:33

is taken care of.

play04:35

The other good thing is that my code doesn't need to be platform dependent.

play04:38

I can take a Windows computer and run Linux on top of it.

play04:41

So I have a 64 GB Windows computer I can run,

play04:44

let's say four or five Linux computers on top of it.

play04:46

And my code doesn't need to know that deep down there is windows running.

play04:51

The third thing is that this is very flexible.

play04:53

The provisioning of these resources is quite dynamic.

play04:56

All I need to do is shut down my virtual machine and restart a new machine.

play04:59

I don't need to go to the shop and buy a different computer.

play05:03

And amongst these three,

play05:04

I think platform independence is probably the game changer here,

play05:07

because if you remember Java, when it came as a language,

play05:10

so many people adopted it because you no longer had to take OS considerations.

play05:14

You could push that onto the ops team. You just needed the .class files,

play05:18

and you could run the program on any operating system.

play05:20

So this was a big deal because people could just go to these cloud providers and

play05:24

ask them for a virtual machine and they would get it very cheap.

play05:27

But one of the problems with the virtual machine is that when you're running a

play05:29

program, you don't want to start an entire virtual machine.

play05:32

It's like booting up your computer. It takes some time. It takes a few seconds.

play05:36

And then the idea came up that, Hey, you just need processing power, memory,

play05:40

disk and IO. These 4 resources.

play05:46

Taking all this into consideration, there came something like lightweight OSes.

play05:51

They were a precursor for something called Containers.

play05:54

Containers are effectively a form of virtualization.

play05:57

What they let you do is app isolation.

play05:59

You're not going to be having all the features of OS isolation, you know,

play06:03

virtual machines. But you don't really need that.

play06:06

And the benefit is that you just need to tear down and build this lightweight

play06:09

container. So that's faster when it comes to boot times. Interestingly,

play06:14

this process of building and tearing down is called mounting and mounting a

play06:18

disc. In school, if you guys worked on, you know, CDs and stuff.

play06:23

We would mountain and unmount disks. That would be like a virtual machine,

play06:27

which would be allowing you to read the contents of the disc. Similarly,

play06:31

in a container you specify the operating system and your disc requirements.

play06:36

And then the mounting process figures out the underlying file system,

play06:41

which you'll be using through the interface of the container.

play06:45

So technologies like Docker have done the same thing that Java did for

play06:48

programming languages.

play06:49

It's a way for us to move all these considerations back to the developer.

play06:54

The developer can specify that these are the resources I need.

play06:57

This is the operating system I will be running on.

play06:59

And you don't need to worry about the hardware so much. Docker will handle that.

play07:02

It'll create an interface which will be interacting with the hardware or the

play07:05

virtual machine. Whatever be the case.

play07:07

And create a container on top of it and let your program interact with the

play07:11

interface. When it needs more memory, it just asks and it gets it.

play07:15

So the advantages of using containers is clear.

play07:17

But the major disadvantage that I can see is that containers also considered a

play07:21

little slow. There's also possible firewall issues,

play07:24

which come up because you have containers,

play07:26

although it's much lesser in containers than a virtual machine.

play07:29

In my personal experience.

play07:31

The overhead of container management is also not worth it really,

play07:34

for simple applications.

play07:36

Like places where you know that you don't need containers.

play07:41

So that's it for this containers video,

play07:42

it's a very brief introduction to what they are and why we use them. Of course,

play07:47

there's a lot more detail we can get into.

play07:48

If you'd like that you can post them in the comments below,

play07:50

or you can hit the like on this video.

play07:53

If you want notifications for further videos like this,

play07:55

you can hit the subscribe button. I'll see you next time!

Rate This

5.0 / 5 (0 votes)

Related Tags
VirtualizationContainersCloud ComputingDevOpsResource ManagementSoftware EngineeringCapacity PlanningPlatform IndependenceDockerVMsOS Isolation