Chapter 2. Understanding the Unikernel

Unikernel theory is actually quite easy to understand. Once you understand what a unikernel is and what it is designed to do, its advantages become readily apparent.

Theory Explained

Consider the structure of a “normal” application in memory (see Figure 2-1).

Figure 2-1. Normal application stack

The software can be broken down into two address spaces: the kernel space and the user space. The kernel space has the functions covered by the operating system and shared libraries. These include low-level functions like disk I/O, filesystem access, memory management, shared libraries, and more. It also provides process isolation, process scheduling, and other functions needed by multiuser operating systems. The user space, on the other hand, contains the application code. From the perspective of the end user, the user space contains the code you want to run, while the kernel space contains the code that needs to exist for the user space code to actually function. Or, to put it more simply, the user space is the interesting stuff, while the kernel space contains the other stuff needed to make that interesting stuff actually work.

The structure of a unikernel, however, is a little different (see Figure 2-2).

Figure 2-2. Unikernel application stack ...

Get Unikernels now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.