I Want To Run Stateful Containers, Too

Comment

Dean Peterson

Contributor

Dean Peterson is co-founder of abecorn and a solutions architect for the State of Minnesota at the Department of Employment and Economic Development.

Using Amazon for everything feels wrong to me — a bit like the rebels in Star Wars renting a Star Destroyer from Darth Vader rather than recruiting the Millennium Falcon to fight the Empire.

“Raaaw, don’t run stateful apps in a container, Raaaw.” That is what currently stands for sound advice in the development/operations world. I hear it parroted over and over. I get it; running stateful applications in a container is hard. However, nobody should be paying you to spin up 1,000 stateless containers to print “hello world” then click a button in Amazon for the hard stateful parts.

You give yourself an out by saying you are following the guidelines of the “12 Factor App.” That tells you writing applications born in the cloud should attach stateful services separately. All you really need to own is dynamically scaling that amazing stateless “hello world” app you wrote using React and Node.js.

Amazon, MongoLabs, Rackspace, Microsoft; they all whisper sweet nothings in your ear. “Run along child, go play with Angular 2, Node.js, React; give Spring Boot, Rat Pack and Polymer a try. Leave the hard stateful parts to us.” You agree and start putting everything in Amazon’s cloud. They get you hooked on their drug. Then, when it is too late, you learn the real cost of “all your data are belong to us.”

Let me back up a minute and tell you why I am writing this and what I want (short version:  I want Google’s Kubernetes, Docker and OpenShift to step up their game). I am working on a rewrite of a large-scale application at my place of employment. We are fed up with the complexity that has grown inside a monolith and have decided to pursue a micro-services architecture. The promise of smaller, more maintainable apps keeps me working all hours day and night.

This is how things progress. I learn Angular 1, Bootstrap, Grunt, the JBoss stack: REST services running in Wildfly’s JEE7 app server, and I secure everything with a central OAuth/OpenID Connect provider to make it easy to share user credentials in a number of separate applications.

Yes, I know JEE7 sucks and Angular 2 breaks backward compatibility with Angular 1 (not the focus of this article). And yes, I was once a native JavaScript fanboy, so I know frameworks like Angular are just awful too. I don’t really think they are awful, but I do think the slowness on mobile is. However, that is a conspiracy for another time (I think it stems from the unnecessary lack of memory and storage space on mobile devices so Google and Apple can sell cloud storage for your 20 billion baby pictures).

Back to my point (I think I have one).

Inevitably, we realize reduced complexity in app development is traded for increased complexity in operations; all of these services and separate clients and databases need to be built, deployed and managed in a sane way.

I dive head first into the “DevOps” world. I learn straight Docker and use Docker Compose to orchestrate running containers for app services, clients and a single MongoDB node. Plus, containers for etcd (name value storage for ip/ports), registrator (used to keep etcd in synch), nginx (load balancing services) and confd to reconfigure nginx dynamically as containers start and stop. “Yes, I am amazing!” At least, that is what I think until I realize Docker Compose falls very short of making easy the management of those containers.

I do not attempt to scale the setup with Docker Swarm. There are too many moving parts in the makeshift PAAS to justify selling it to management. If the complexity is too much running containers on one node, throwing Docker Swarm into the mix I imagine to be a nightmare.

At this point, my notion is that stateful applications, such as MongoDB, should run in containers alongside stateless clients and services. I didn’t know that makes me foolish. Like a naive dreamer, I thought the value of containers was to make your entire app easy to scale. I was unaware the community had already given an official name to their surrender (Backing Services).

With some Docker experience under my belt, I take another look at the Docker PAAS landscape. I need something a bit more robust than Docker Compose and Docker Swarm. How do I choose? There is Kubernetes, Fleet and Mesos. But wait. I don’t use those directly? They are for the use of platform developers?

Eventually I understand; they are the technology behind a number of other platforms meant for use by me (the developer). I need to choose my platform after I choose from the lower level technology. Kubernetes, being from Google, has a huge following, is open source and plays well with the Docker knowledge I already have. I choose Kubernetes.

Now I need to choose a Kubernetes platform. I already use Red Hat Enterprise Linux to run Docker containers and some of the JBoss stack, so I choose OpenShift Origin. I spend weeks learning OpenShift. I spend hours communicating with OpenShift developers and finally get everything I had running with Docker and Docker Compose running on OpenShift Origin.

Except now I have a build and deployment piece, images automatically get pushed to a registry, I can dynamically scale up and down pods, easily, with a single line command and load balancing is baked into every service I create. Life is good. Except I am still stuck on scaling my stateful MongoDB service. Every PAAS has templates for running a MongoDB database. They all stop at the easy part and leave the hard part to us.

If anyone has used MongoDB, they know the hard part is getting a “production-ready” MongoDB instance. That means at least running a MongoDB replica set. For a truly production-level configuration, a sharded cluster is required. It gets complicated quickly. There should be a template for doing that in someone’s platform. There is not. Right now, OpenShift is blocked because Kubernetes needs to figure out how to attach separate persistent volumes to pods in the same service. They have made that a Priority 2. It should be a Priority 1.

This makes me seriously consider switching. Tutum is bought by Docker. OK, maybe I go back to the Docker camp and use Tutum. No, they also stop at the easy part and only have an example for a single development MongoDB node. They are still trying to integrate with Flocker, which means they are nowhere near solving the problem.

All right, I consider leaving the Docker container world entirely for stateful services because I find an Ansible template to do what I want. However, it is out of date and only works with Red Hat 6. That is the problem with Ansible; Ansible playbooks depend on their environment. Docker images are portable and I know they will run.

I want a tool that has a repository of templates for making formations of very hard things easy. If that existed I would not need Amazon to do every hard thing for me. I can mostly get what I want on Amazon. But look at the prices:

hi-res-cost-chart
Estimated prices for hosting MongoDB on Amazon using CloudFormations.

 

They get you hooked for free and the next level is $1,496 per month… wtf! MongoLabs is little better. I don’t understand why everything is becoming an exorbitantly priced service. Keep in mind, platform as a service providers should have templates for hard-to-set-up stateful services like MongoDB.

Rather than use templates from IAAS providers, I should be able to use someone else’s platform running on my chosen cloud/IAAS provider (call it what you like), like Amazon, to put pressure on them to lower prices. If they know it is easy to leave, their prices will go down. Let’s take back some of our ability to do hard things wherever we choose so that running a database does not cost … wait, what, $21,430 per month?

Please, tell me I’m crazy. Tell me why I’m wrong. I sincerely want to know. So many products are inches from being able to compete with Amazon and give choice back to developers whether they want to run on Amazon or retain a bit more freedom (perhaps even run in another cloud or local cloud environment). Soon, Kubernetes will allow complicated stateful services to run inside containers.

Meanwhile, Amazon announces competing components daily. Amazon has API Gateways, CloudFormations to spin up almost any stack or service, CodePipeline for continuous delivery, load balancing; you name, it they have it.

Now, you might be wondering, what is the problem? Just go with Amazon, everyone is doing it. “You aren’t cool unless you’re using Amazon.” I do work for a large organization that can afford to run everything on Amazon (maybe ;  some would disagree). However, I also work intensely on the multi-way trading platform Abecorn.com. That has no VC funding; I have learned to “do more with less.”

Using Amazon for everything feels wrong to me — a bit like the rebels in Star Wars renting a Star Destroyer from Darth Vader rather than recruiting the Millennium Falcon to fight the Empire. Amazon spins up virtual machines (Amazon Machine Images) for many services. They should be using containers to increase density and lower costs. Besides that, there are features missing in the Amazon container platform.

Native Amazon container support comes in two flavors: Amazon EC2 Container Service and Docker on AWS Elastic Beanstalk. Docker on AWS Elastic Beanstalk is more equivalent to a PAAS and uses Amazon EC2 Container Service under the covers. That offers a way to run and automatically scale containers; Amazon does not offer a way to seamlessly build and store container images. You must pull pre-built Docker containers from a third-party registry because the Amazon Container Registry is not yet available.

Plus, there is no Amazon tool designed specifically to build containers. Combining layers of Docker files to create a complete container image is no trivial task. A number of platforms, including OpenShift, already have container build configurations to make the process easy. Another crucial component is a shared file system for Docker containers.

Right now, Amazon’s Elastic File System is in preview mode. You have to ask permission to use it (I am still waiting). OpenShift already allows me to use a number of different shared file systems, including NFS (Network File System), which Amazon Elastic File System is. It is useful to have the ability to share persistent data between containers (potentially running on separate nodes in a cluster) using NFS mounts. A Network File System would allow Lucene indexes stored on the file system to be shared between containers spanning multiple nodes.

I have run containers on bare metal and in Amazon. Performance can be noticeably slower in Amazon on machines with similar specifications. A detailed explanation why is in this informative video by Bryan Cantrill. It is a talk about how layering containers on top of virtual machines is a recipe for poor performance and wasted resource utilization. He equates it to developers “being given fire, then proceeding to put the fire out.”

All Amazon machine images are virtual machines. When you run containers in Amazon you are running them in virtual machines. New providers are available that let you run containers on bare metal to maximize their performance. They can provide that service economically due to the greatly improved density of applications running in containers.

I am all for “the cloud,” but the cloud does not necessarily mean All Amazon, All The Time. Amazon is actively blurring the line between IAAS (Infrastructure As a Service) and PAAS (Platform As a Service). It is only recently that they have introduced newer developer-focused DevOps tools like EC2 Container services and Docker on AWS Elastic Beanstalk. Just because they are accepted as the dominate provider of IAAS should not give them uncontested dominance in developer-centric platforms. It is OK to use Amazon’s infrastructure, but give yourself the flexibility to move by using a portable PAAS like Kubernetes.

If not, soon, we all may be waiting for Amazon to come out with the missing service we need. Let me give you a glimpse of the future.

Example conversation between Bob the architect and management.

Management: Bob, how do you suggest this application be written?

Bob: Amazon

ManagementBut what about…

Bob: Amazon

Management: Yeah but…

Bob: Amazon

Management: Genius Bob, you’ve done it again. I have what I need, let me run this up the flag pole.

More TechCrunch

China has closed a third state-backed investment fund to bolster its semiconductor industry and reduce reliance on other nations, both for using and for manufacturing wafers — prioritizing what is…

China’s $47B semiconductor fund puts chip sovereignty front and center

Apple’s annual list of what it considers the best and most innovative software available on its platform is turning its attention to the little guy.

Apple’s Design Awards nominees highlight indies and startups, largely ignore AI (except for Arc)

The spyware maker’s founder, Bryan Fleming, said pcTattletale is “out of business and completely done,” following a data breach.

Spyware maker pcTattletale shutters after data breach

AI models are always surprising us, not just in what they can do, but what they can’t, and why. An interesting new behavior is both superficial and revealing about these…

AI models have favorite numbers, because they think they’re people

On Friday, Pal Kovacs was listening to the long-awaited new album from rock and metal giants Bring Me The Horizon when he noticed a strange sound at the end of…

Rock band’s hidden hacking-themed website gets hacked

Jan Leike, a leading AI researcher who earlier this month resigned from OpenAI before publicly criticizing the company’s approach to AI safety, has joined OpenAI rival Anthropic to lead a…

Anthropic hires former OpenAI safety lead to head up new team

Welcome to TechCrunch Fintech! This week, we’re looking at the long-term implications of Synapse’s bankruptcy on the fintech sector, Majority’s impressive ARR milestone, and more!  To get a roundup of…

The demise of BaaS fintech Synapse could derail the funding prospects for other startups in the space

YouTube’s free Playables don’t directly challenge the app store model or break Apple’s rules. However, they do compete with the App Store’s free games.

YouTube’s free games catalog ‘Playables’ rolls out to all users

Featured Article

A comprehensive list of 2024 tech layoffs

The tech layoff wave is still going strong in 2024. Following significant workforce reductions in 2022 and 2023, this year has already seen 60,000 job cuts across 254 companies, according to independent layoffs tracker Layoffs.fyi. Companies like Tesla, Amazon, Google, TikTok, Snap and Microsoft have conducted sizable layoffs in the first months of 2024. Smaller-sized…

9 hours ago
A comprehensive list of 2024 tech layoffs

OpenAI has formed a new committee to oversee “critical” safety and security decisions related to the company’s projects and operations. But, in a move that’s sure to raise the ire…

OpenAI’s new safety committee is made up of all insiders

Time is running out for tech enthusiasts and entrepreneurs to secure their early-bird tickets for TechCrunch Disrupt 2024! With only four days left until the May 31 deadline, now is…

Early bird gets the savings — 4 days left for Disrupt sale

AI may not be up to the task of replacing Google Search just yet, but it can be useful in more specific contexts — including handling the drudgery that comes…

Skej’s AI meeting scheduling assistant works like adding an EA to your email

Faircado has built a browser extension that suggests pre-owned alternatives for ecommerce listings.

Faircado raises $3M to nudge people to buy pre-owned goods

Tumblr, the blogging site acquired twice, is launching its “Communities” feature in open beta, the Tumblr Labs division has announced. The feature offers a dedicated space for users to connect…

Tumblr launches its semi-private Communities in open beta

Remittances from workers in the U.S. to their families and friends in Latin America amounted to $155 billion in 2023. With such a huge opportunity, banks, money transfer companies, retailers,…

Félix Pago raises $15.5 million to help Latino workers send money home via WhatsApp

Google said today it’s adding new AI-powered features such as a writing assistant and a wallpaper creator and providing easy access to Gemini chatbot to its Chromebook Plus line of…

Google adds AI-powered features to Chromebook

The dynamic duo behind the Grammy Award–winning music group the Chainsmokers, Alex Pall and Drew Taggart, are set to bring their entrepreneurial expertise to TechCrunch Disrupt 2024. Known for their…

The Chainsmokers light up Disrupt 2024

The deal will give LumApps a big nest egg to make acquisitions and scale its business.

LumApps, the French ‘intranet super app,’ sells majority stake to Bridgepoint in a $650M deal

Featured Article

More neobanks are becoming mobile networks — and Nubank wants a piece of the action

Nubank is taking its first tentative steps into the mobile network realm, as the NYSE-traded Brazilian neobank rolls out an eSIM (embedded SIM) service for travelers. The service will give customers access to 10GB of free roaming internet in more than 40 countries without having to switch out their own existing physical SIM card or…

16 hours ago
More neobanks are becoming mobile networks — and Nubank wants a piece of the action

Infra.Market, an Indian startup that helps construction and real estate firms procure materials, has raised $50M from MARS Unicorn Fund.

MARS doubles down on India’s Infra.Market with new $50M investment

Small operations can lose customers by not offering financing, something the Berlin-based startup wants to change.

Cloover wants to speed solar adoption by helping installers finance new sales

India’s Adani Group is in discussions to venture into digital payments and e-commerce, according to a report.

Adani looks to battle Reliance, Walmart in India’s e-commerce, payments race, report says

Ledger, a French startup mostly known for its secure crypto hardware wallets, has started shipping new wallets nearly 18 months after announcing the latest Ledger Stax devices. The updated wallet…

Ledger starts shipping its high-end hardware crypto wallet

A data protection taskforce that’s spent over a year considering how the European Union’s data protection rulebook applies to OpenAI’s viral chatbot, ChatGPT, reported preliminary conclusions Friday. The top-line takeaway…

EU’s ChatGPT taskforce offers first look at detangling the AI chatbot’s privacy compliance

Here’s a shoutout to LatAm early-stage startup founders! We want YOU to apply for the Startup Battlefield 200 at TechCrunch Disrupt 2024. But you’d better hurry — time is running…

LatAm startups: Apply to Startup Battlefield 200

The countdown to early-bird savings for TechCrunch Disrupt, taking place October 28–30 in San Francisco, continues. You have just five days left to save up to $800 on the price…

5 days left to get your early-bird Disrupt passes

Venture investment into Spanish startups also held up quite well, with €2.2 billion raised across some 850 funding rounds.

Spanish startups reached €100 billion in aggregate value last year

Featured Article

Onyx Motorbikes was in trouble — and then its 37-year-old owner died

James Khatiblou, the owner and CEO of Onyx Motorbikes, was watching his e-bike startup fall apart.  Onyx was being evicted from its warehouse in El Segundo, near Los Angeles. The company’s unpaid bills were stacking up. Its chief operating officer had abruptly resigned. A shipment of around 100 CTY2 dirt bikes from Chinese supplier Suzhou…

1 day ago
Onyx Motorbikes was in trouble — and then its 37-year-old owner died

Featured Article

Iyo thinks its GenAI earbuds can succeed where Humane and Rabbit stumbled

Iyo represents a third form factor in the push to deliver standalone generative AI devices: Bluetooth earbuds.

1 day ago
Iyo thinks its GenAI earbuds can succeed where Humane and Rabbit stumbled

Arati Prabhakar, profiled as part of TechCrunch’s Women in AI series, is director of the White House Office of Science and Technology Policy.

Women in AI: Arati Prabhakar thinks it’s crucial to get AI ‘right’