Note: What was it like to learn JavaScript in 2016? It is modeled after The circle. ci article It’s The Future, which is The original text of this article.

Hey, boss sent me here to talk to you. I hear you know a lot about Web apps?

— Well, I do more distributed systems now. I just attended ContainerCamp and Gluecon, and I’m going to Dockercon next week. The growth of the industry is exciting, making everything easier and more reliable. This is the future!

Cool! Now I want to build a simple Web application, which is a Add, delete, change and check application made by Rails, and will be deployed on Heroku. Should it still be done?

— Oh, no. Out of date. Heroku is dying. No one’s using it anymore. You should be using Docker now. This is the future.

Oh, all right. Docker is what?

Docker is a new container solution, much like LXC, but also a packaging format, a distribution platform, and a tool that makes it very easy to build distributed systems.

The container is changed… And so on? What is LXE?

— LXC, like super Chroot!

Cher – oot is what?

— Well, here’s the thing. Docker, or containerization, is the future. It’s a lot like virtualization, but faster and cheaper.

Oh, so it’s like Vagrant.

— No, Vagrant is a has-been. Now everything is containerized. This is the future.

Okay, so I don’t need to know anything about virtualization?

— No, you still need virtualization, because containers are not completely secure either. So if you want to run something in multi-tenant Environmen, you need to make sure your users don’t get out of the sandbox.

Okay, I’m a little confused. So let’s go back. So there’s something like virtualization, it’s called a container, and I can use it on Heroku?

— Well, Heroku has some support for Docker, but I already said Heroku is dead. You should run containers on CoreOS.

OK, what is CoreOS?

— This is a Host OS that you can use with Docker. Damn, you don’t even need Docker, you can use RKT.

A Rocket? (The same pronunciation)

– No, RKT.

Yeah, Rocket.

– No, R-K-T. It’s not the same thing at all. This is another containerized format that is not bundled together like Docker and is easier to compose.

RKT please?

B: Sure. Composability is the future.

All right, how do you use it?

— I don’t know. Probably no one uses it either.

Stand hand. You mentioned CoreOS?

— Yes, CoreOS is Docker’s host operating system.

What is the host operating system?

– The host operating system runs all containers.

Run my container?

— Yes, you have to have something to run your containers. For example, you configure an EC2 instance, put CoreOS on it, run the Docker daemon, and deploy the Docker image to it.

Which one of these is the container?

— Everything in it is a container. You see, you write your app, you write a Dockerfile, you build the image locally, and you push it to a Docker host.

Ah, like Heroku?

– Not Heroku. I told you, Heroku is dead. You can now run your own cloud with Docker.

What?

– Well, it’s very simple. Search #gifee.

Gify? (2016, The Year of GIFEE)

— Short for ‘Google’s Infrastructure for Everyone else’, which means Google infrastructure that everyone can use. You pick a few tools from the container, and you have the same infrastructure as Google.

I can just use Google stuff.

— You won’t need it for another six months.

Okay, no one’s hosting this stuff? I really don’t want to do it myself.

— You can use Amazon’s ECS, but you have to write XML.

It?

– the forehead.

– the forehead.

I really don’t want to do it myself.

– No, it’s easy, you just need to configure a Kubernetes cluster.

I need a cluster?

– Kubernetes cluster. It manages the deployment of all services.

I only have one service.

— What do you mean? You have one app, right, so you’re going to have at least 8 to 12 services.

What? No, it’s just an app. Service, what kind of thing. It’s just an application.

— No, look at microservices. Microservices are the future. We all do it now. Break down a huge application into, say, 12 services. Each service only does one thing.

Seems over the top.

— It’s the only way to be reliable. If your authentication service goes down…

Validation service? I’m going to use the gem I’ve been using.

– very good. Take that gem, make it a separate project, add RESTful apis, and then have other services call those apis, gracefully handle errors, etc. Finally, put it in a container and keep delivering.

Okay, so now I have a dozen services that I can’t manage, what’s next?

— I said Kubernetes, which can direct all these services.

The command?

— Yes, since you have these services and they have to be reliable, you have to have multiple copies of them. Kubernetes ensures that you have enough backups, distributed across multiple hosts for fleet, to keep the service running.

Now I need a Fleet?

– Yes, to ensure reliability. But Kubernetes will manage it for you. Kubernetes will work because it’s Google and it runs on ETCD.

Etcd is what?

— is an implementation of RAFT.

RAFT?

— Just like Paxos.

God, when is this chain gonna end? I just want to release an app. Alas. Rely on. All right, take a deep breath. Oh my god. Okay, what is Paxos?

Paxos is like a distributed consistency protocol that no one understood or understood in the 1970s.

Good. Thank you for telling me that. What the hell is Raft?

— Because no one understood Paxos, Diego…

Oh, you know him?

— No, he works for CoreOS. Anyway, Diego built Raft for his PhD thesis, because Paxos is so hard. What a smart guy. Then he wrote ETCD to implement Raft. Finally Aphyr didn’t say it was a piece of shit.

Aphyr is what?

— Aphyr is the guy who wrote “Call Me Maybe,” the distributed systems and BDSM guy.

What? Did you just say BDSM?

— Well, BDSM. Everyone in the Bay Area is using distributed systems and BDSM.

Okay, he wrote “Call Me Maybe”?

— No, he wrote a series of blog posts about why all databases fail to break CAP.

What is CAP?

— CAP theorem, that any distributed system can only choose between Consitency, Availability and Partition Tolerance.

Okay, so all the databases failed to break CAP? What does that mean?

— That means they’re all rubbish, like Mongo.

I thought Mongo was scalable.

— No one thought of it that way.

Okay, what about etCD?

– ETCD is a distributed key-value repository.

Oh, like Redis.

— No, nothing like Redis. Etcd is distributed. If there is a network partition, Redis will lose half of the writes.

Well, ETCD is a distributed key-value repository. Why is this useful?

Kubernetes can use ETCD to configure a standard 5-node cluster as a Message bus. Etcd combined with some Kubernetes services can provide a fairly robust command system.

Five nodes? I only have one app. How many machines do I need altogether?

— Well, you need about 12 services, each with some redundancy, some load balancers, etCD clusters, databases, and Kubernetes clusters. About 50 containers.

— A piece of cake! Containers are very efficient, and you can deploy them on about eight machines! Isn’t that amazing?

Maybe, with these services, I can always deploy my applications?

— Sure, but storage is still a problem and networking takes a lot of work, but that’s about it!

Like this. Okay, I think I get it.

— Great!

Thank you for explaining that.

– all right.

Let me say it again. Let me see if I understand.

– good!

So, I need to decompose a simple add, delete, change and check application into 12 microservices, each of which has its own API, can call other microservices’ apis, and can handle errors robustingly, and then put the microservices into the Docker container. Start up 8 Docker hosted machines running CoreOS, “direct” them with a small Kubernetes cluster running ETCD, then solve network and storage problems, and continuously deliver multiple redundant backups of each microservice to 8 machines. Isn’t it?

– to! Isn’t it great?

I’m gonna go back to Heroku.