Python in the Clouds

Wray Mills
The Art of Tech Training
4 min readFeb 13, 2017

Definitely not snakes on a plane.

Python’s rise in popularity has been amazing to witness, especially for a 20+ year Python fan. Flying Python on AWS Lambda services in the cloud takes the language to new and exciting heights.

Python has been a go-to language for me since the mid 90’s. Currently, it is my preferred language for teaching kids (including my own) Computer Science and programming. Many of the students’ Python programs end up running directly in front of us on a RaspberryPi; very much on the ground and far from the clouds. We have dozens of lessons combining Python and the Pi and sensors and LEDs and even Minecraft — exposing kids (and adults) to coding and all the nuances of hardware, from wiring to Linux configuration. It was difficult to then cover elementary aspects of distributed and cloud computing without a lot of hand-waving and boiling down the hours of pre-work/configuration we had done to prepare their environments in the cloud. With CI/CD tools, we can make cloud deployment very easy for the kids, but it was unlike the Pi projects where they are actively involved in all the steps. Abstraction can be a good thing for a professional organization, but openness and clear-box hands-on experimentation is best for instruction. Unfortunately, our students’ learning about the cloud wasn’t much more than drawing a cloud on the whiteboard with a bunch of boxes floating around and leaving the details of how to run code in the cloud for more advanced classes.

Python + Lambda simplifies the cloud.

Enter lambda. Now, we can take the same basic Python programs that kids have written to learn how to code and upload them to lambda services. This is an amazingly simple trick with incredible results. Imagine how fun this is to teach —“take this simple function and copy it in here and now it can be invoked anytime, from anywhere, any number of times”. It provides us the perfectly simple platform to compare/contrast running code locally with running code in the cloud. Oh, and take that crude text-based command-line interface and replace it with SSML and now elementary python code becomes the engine behind a skill invoked by your voice, anytime, anywhere, pretty much for no cost: “Alexa, thank you”.

Please, pause and contemplate where we are with this. Take your tested code, move it to the cloud and with no server config and very little network fanfare and it is runnable by the world. Period. So easy, an Elementary student can do it after only a few hours of Python introduction.

If this doesn’t make everyone want to learn Python (or even Node.js), I’m not sure what else will. AWS Lambda services, with the help of Python, is a critical turning point in the industry. Java entered the world with its vision of write once, run everywhere — leaving out the harsh details about distributing that code everywhere onto platforms that are not close to being uniform with variations that are impossible to test. Code bloat was immediate and containers implementing specifications to protect ourselves from ourselves continue to get in the way of standing up simple services that scale. Python on Lambda is write once, and call from anywhere and everywhere where all execution (and thus monitoring and logging) is centralized. The Lambda “container” is the epitome of simple, and the statelessness ensures a focus on API-oriented functions that can immediately scale; using methods that focus on code-first, configuration-never. Is this not the evolution of convention over configuration and opinionated frameworks?

The 1997 me would think that we have come full circle back to DCE and Encina and its stateless procedural services, and in some ways we have; except for the fact that we (well, AWS in this case) have mastered truly large scale distributed server(less). We now truly achieve the goal of writing code once and deploying it easily once to one virtual location that is executed when needed, not how configured (and no rpc_ss_allocate :) ). Oh, and to reinforce the simplicity; it is easy enough to explain, code, and deploy with a fifth grader — try that with DCE, CORBA, EJB, Rails, Django, Angular/Node.JS, JHipster, …

So please, if you haven’t done so already, please go fly some Python snakes on a Lambda plane and clear your mind for innovation and differentiation instead of configuration and scaling optimization. Then, share your learnings with kids and build an Alexa skill or two. And you needn’t worry if you are deploying a service for the masses (the killer app), for these snakes will scale!

--

--

Wray Mills
The Art of Tech Training

Husband, father, geek, cloud maker, founder of Tech Em Studios