The Original Application

Create a CRUD application for pet service, which is based on API Gateway HTTP API.

We'll cover the following

Overview

In this chapter, we deviate from our normal approach and take a pre-written application as our starting point. It’s called Pet Service and is written in an imperative style, using both objects and functions. Despite some advantages, there are numerous issues with this coding approach, which we’ll explore here.

Pet Service is a CRUD application that stores information about pets and wild animals. Pets have more attributes than wild animals (like cuteness), but for the latter, we save a counter for each type of animal because we might like to know just how many lions are out there, both for preservation and safety purposes.

The infrastructure setup is quite similar to what we’ve been doing in earlier chapters. Our code sits behind an API Gateway HTTP API (a variation on the kind of API Gateway we used previously, but faster, cheaper, and a bit simpler). This API sends every call to a greedy endpoint, a (fat) Lambda that takes care of further routing. Once again, DynamoDB serves as the database.

Get hands-on with 1200+ tech skills courses.