Francesco Ciulla Profile picture
Sep 30, 2021 18 tweets 6 min read Read on X
Why Containerization?

This is the question I get more often.

Over the years I have tried to improve this answer as much as possible.

In this thread with Memes, I will do my best.

a /thread (with Memes)
When an application is developed, we have:

- a development environment
- a production environment.

The application is created, improved, new features are added, bugs are corrected.

All of this happens in the development environment.

No memes? wait for it...
We have the usual problems:

- install dependencies
- understand what the problem is
- add a new shiny feature

And we also write a lot of code...

Once the development is done, developers are happy!
Why? because “It works on my machine”.

What's the problem?
When we go into production, we would like to recreate the same, identical environment.

What we can do is write a procedure to recreate the same exact environment. We could have issues because, for example, we are on a different operating system!
We would have to reinstall the same dependencies and we would have to re-create the same configuration on the production machine, and we would have many problems.

Now, to be completely honest, this problem has already been solved in the past: With virtual machines.
We create a virtual machine, which contains an operating system, and all necessary dependencies and configurations

Then we run the virtual machine on the operating system of the physical machine through a Hypervisor (a tool to manage Virtual Machines).
Problem solved, right?

Well yes and no, because even virtual machines have their own operating system, and they must be configured correctly to work, so we are (almost) at the starting point.
To create virtual machines we have a very long configuration written somewhere, and if something changes it must be carefully noted down.

Furthermore, it is quite evident that we are facing a waste of resources: We are recreating an entire system on top of a system
We would just ship our (maybe small) application with our dependencies!

So why am I here saying say that containers are cool and that Docker is awesome?

Because containers solve the same problem, the shipping of an application, in a much simpler and smarter way.
Containerization technologies (Docker is just one of them) use a standard, to isolate the application with all:

- dependencies
- configuration
- code

in something called Images.

Based on these images, containers can be created and started.
To make an analogy with the world of programming, an image is a class, and a container is an instance of that class.

The good news is that a ton of images, of the most famous technologies, already exists!
Another advantage of using containerization since development is the possibility of using different versions for different projects at the same time (without even installing them).
For things like Node.js, there are solutions, like NVM, to switch between versions, but for others is not that easy.

Let's say we want to use Postgres version 10 for one project but we need to use Postgres 9 for another.

And we also have Postgres 12 installed.
Now, using all 3 of them, changing ports every time depending on which project you are working on, is really a pain and it can lead to headaches.

Instead, we would like to have separated dev environments for the 2 projects, without configuring ad-hoc machines
We could solve this using VM, but then we should manage them and it's very resource consuming

This with docker can be avoided, simply by using a version of Postgres present on Docker Hub (a docker registry that contains a lot of images).
Also in a company, a machine can be configured so different developers can work on different projects using different versions at the same time

They can work on different projects without colliding.

They can work on different versions of the same project!
Last thing...

Docker can't solve all your problems!

But it can make your life easier as a developer, which is already a lot!
If you like this style of teaching, please follow @FrancescoCiull4 and RT this to spread the word. Thank you

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Francesco Ciulla

Francesco Ciulla Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @FrancescoCiull4

Nov 18, 2023
14 Fundamental Docker Definitions for:

🏠 Docker Host
⚙️ Docker Engine
📱 Docker Client
👹 Docker Daemon
📝 Dockerfile
🧱 Docker Image
🐳 Docker Container
🌐 Docker Network
📀 Docker Volumes
🧩 Docker Compose
📚 Docker Registry
🌍 Docker Hub
🚀Docker Init
🔎Docker scout

1/14 🏠Docker (Active) Host

A computer with Docker installed and the daemon running.

It can process Docker and non-Docker workloads.
2/14 ⚙️Docker Engine

A Client-Server application.
It has 3 components:

- CLI: A command-line interface client.

- daemon process: A server that is a type of long-running program.

- Rest API: to specify interfaces programs can use to talk and interact with the daemon.
Read 15 tweets
Sep 28, 2023
What is an ABI in the Ethereum ecosystem?

Let's know more about it in 2 minutes.

what is ABi? - Ethereum connected to a globe with a JSON file
Application Binary Interface (ABI) definition

It's the standard way to interact with contracts in the Ethereum ecosystem:
- from outside the blockchain
- for contract-to-contract interaction

Data is encoded according to its type.

The encoding requires a schema to decode
Assumptions

Assumptions for contracts:
- interface functions are strongly typed, known at compilation time, static
- they'll have interface definitions of contracts they call available at compile-time

This is not for contracts with:
- dynamic interface
- only known at run-time
Read 13 tweets
May 19, 2023
Blockchain introduction.

A thread: Ethereum logo - Blockchain ...
At its core, A Blockchain is a type of distributed ledger technology.

What is a Distributed Ledger Technology (DLT)?

Keep reading.
DLT is a digital system for recording transactions in multiple places at the same time.

There is no central data store/admin functionality.

It's a decentralized and transparent method for:
- recording
- sharing
- synchronizing

transactions across a network of participants.
Read 15 tweets
May 10, 2023
What is the Ethereum Virtual Machine⚙️(EVM)?

Have you ever heard about it and you want to know more?

In this thread, we will see some basic concepts for the EVM.

Image
The Ethereum Virtual Machine (EVM) is a key component of the Ethereum blockchain.

It's a virtual machine that executes smart contracts written in Solidity or other programming languages.
EVM is a Smart Contract Enabler

The EVM is crucial to Ethereum's decentralization:

it enables smart contracts to run in a distributed and trustless environment.
Read 14 tweets
May 10, 2023
Python🐍 for beginners.

Python is a language for (but not only):
▫️ AI
▫️ data analysis
▫️ web dev
▫️ blockchain

If you are curious about this amazing programming language,

this thread is for you: Python for beginners - a LA...
0/n Introduction

Python is:
- interpreted: (source code is converted into bytecode executed by the Python virtual machine)
- dynamically typed
- garbage-collected

It supports multiple programming paradigms, including:
- structured
- OOP
- functional
1/n Curiosity about Python's name:

Although Python has a snake as a logo, its name was inspired by the British comedy series "Monty Python's Flying Circus."

This comedy series aired during Python's development and entertained Van Rossum during that period.
Read 25 tweets
Apr 22, 2023
Kubernetes. A thread: Kubernetes - k8s for friend...
What is Kubernetes (K8S)

Kubernetes is an open-source container orchestration platform designed to automate containerized systems':
- deployment
- scaling
- and management.

It's thought to be a tool for production environments...

Let's start:
Containers and K8s

Before we keep going, let's see the difference between containers and K8s

Containers: package an app with dependencies, ensuring it runs consistently across different environments.

K8s helps you:
- manage
- deploy
- scale those containers effectively
Read 14 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(