Sharpen the Saw

Sharpen the Saw

Years ago, I read Stephen Covey’s The Seven Habits of Highly Effective People. Habit 7 is Sharpen the Saw. In the chapter regarding this habit, Stephen related a parable:

A man was walking through a forest when he came across a frustrated lumberjack. The lumberjack was trying to cut down a tree, swearing and cursing as he labored in vain.

“What’s the problem?” the man asked.

“My saw’s blunt and won’t cut the tree properly,” the lumberjack responded.

“Why don’t you just sharpen it?”

“Because then I would have to stop sawing,” said the lumberjack.

“But if you sharpen your saw, you could cut more efficiently and effectively than before.”

“But I don’t have time to stop!” the lumberjack retorted, getting more frustrated.

I always try to find time to stop, when and where I can, to investigate technical topics related to software engineering, in order to “sharpen my saw.” Of course, it helps that I still love my field of work!   

This past weekend, I had the pleasure of going through a brand new book, Serverless Applications with Node.js. Not only is the topic interesting, new, and relevant, but one of the authors, Aleksander Simović, is an engineer on my team!

Some Assembly Required

(I am not referring to Assembly Language…)

This is a book primarily for Software Engineers. For most of the content (the fun, programming parts), the expectation is that you will be able to set up a development environment with Node.js and other tools, can configure AWS components, and are comfortable with light programming. Really, setting up the environment is the toughest part; the programming is pretty intuitive. So, while the book is quite technical, the tools the books evangelizes, Node.js and Claudia.js, are quite easy to use if you have a little bit of programming savvy (preferably with JavaScript).

If you are wondering if this topic might be for you, you can first check out the Serverless Architectures article on the always great Martin Fowler site.

Serverless?

Despite its name, serverless computing is not actually computing without servers. Rather, for serverless architectures you do not need to specify, configure, or manage physical or virtual servers; instead, you write your code and deploy it to a generic virtual server. The vast majority of the DevOps details, like startup, memory allocation, load balancing, and scaling, are abstracted away.  

You need to write your code in more of a microservice (or SOA) style, and like microservices, serverless architectures do not work for every application. For instance, large programs that run for extended periods of time are generally not a good fit for serverless. Of course, if you did have a large, slow program, you could consider breaking it down into smaller components, in which case it may then actually fit the serverless paradigm!

Breaking Down the Book, Part 1

The book is separated into three major sections, each with a number of chapters. Unless you’ve recently been working with all of these technologies, you will probably will need to jump directly to Appendix A (like I did) to figure out how to install all of the relevant technologies. The Claudia.js site is particularly useful for fleshing out some of the installation steps.

Once you are set up and ready to code, you can dig into Part 1, in which the serverless basics are described and the simplest programming tasks laid out. With a little effort you can soon have your own serverless application running on AWS Lambda! It’s so simple that you might wonder what all the fuss was about. This is exactly the point: serverless is simple.

As you would expect, the book builds out how to develop your program (a pizza store application) in each chapter. As you continue through Part 1, you’ll use S3, DynamoDB, the API Gateway, and AWS Cognito. You won’t become an expert on any of these technologies, but you will gain a hands-on appreciation for them.

Part 2

More advanced integrations are introduced in Part 2, where you can learn how to hook up your app to Facebook Messenger, Twilio’s SMS service, and Alexa with simple voice control. (Stripe, the payment service, is included in Part 3). One of the great things about this book is that it finds simple ways to introduce modern technologies into the mix. Again, you won’t become an instant expert, but you will whet your appetite.

As this is a programming book, there are quite a few useful techniques that are presented, in context and in easy-to-consume forms. For instance: Asynchronous JavaScript, debugging Serverless apps, logging apps, working with files, and testing async apps.

Part 3

For you management types, or for those of you who just want an overview, there are some great chapters toward the end of the book covering various aspects such as the testing of serverless apps, conversion or migrating to serverless, and (my favorites) a couple of real-world case studies.  

These case studies alone, for CodePen, and MindMup, are worth the price of the book for folks who want to understand how serverless might work for their needs. If you are curious as to how a serverless application works in the real world, go check out those sites. Spoiler alert: you cannot tell that they are implemented with serverless technologies—they work pretty much the same as any other site. This is just how it should be: Serverless provides new tools you can leverage while still getting the same good results you expect.

Keep Sharpening

Even after all my years of programming I still get a little thrill when I get code up and running successfully. And I love the fact that my chosen field constantly provides new and interesting areas for me to investigate. I’ve had a lot of fun with Serverless Applications with Node.js., but I haven’t finished all of the assignments just yet. So I guess I will keep on sharpening my saw!

Leave a Reply

Your email address will not be published. Required fields are marked *