Introduction

About me

I’m passionate about API development, good practices, performance optimizations and educating people to strive for quality. I have about two decades of experience writing and optimizing software, and often solve real problems in various programming languages, Go being my favorite.

You might know some of my work from:

Professionally I specialize in writing APIs in the social/media industry and for various content management products. Due to the public exposure of such APIs, it’s performance characteristics are of paramount importance. I’m a solid MySQL DBA with experience on other databases as well.

I have strong opinions about PHP. I’ve spent the better part of two decades writing PHP code. I have love for Go, and thankfully that doesn’t require me to have a super strong opinion, because it’s harder to find really bad code. Honestly, the worst you can do is not handle errors and I’ll be judging you. Disagree? Tweet @TitPetric and let me know.

I’ve written a professional dedicated API framework which doubles as an software development kit for the Slovenian national TV and Radio station website, RTV Slovenia. The architecture being put in place with this book is meant to replace and implement the most critical microservices with.

Who is this book for?

This book is for everyone who writes applications for a living. I will cover a wide area of subjects that are related to effective microservice development.

You’ll super love this book if you’re into CI and DevOps. I hope to show you a bit of the world outside of Go, with examples of effective approaches you can use to develop your microservices.

It is the intent of the book to provide a daily exercise which will teach you things about Drone CI, bash, Makefiles, Docker, and anything else which might help you put together the foundation for your microservice or app.

In the book, I will cover these subjects:

  1. Go: Introduction to Protobuf: Messages
  2. Go: Introduction to Protobuf: Services
  3. Go: Introduction to Protobuf: gRPC
  4. Make: Dynamic Makefile targets
  5. Bash: Poor mans code generation
  6. Bash: Embedding files into Go
  7. Go: Scaffolding database migrations
  8. Drone CI: Testing database migrations
  9. Go: Database first struct generation
  10. Go: Generating database schema documentation
  11. Go: Dependency injection with Wire
  12. Docker: Building images with security in mind
  13. Go: implementing a microservice
  14. Docker/Bash: Issuing requests against our microservice
  15. Go: Improving our database handling
  16. Go: Instrumenting the HTTP service with Elastic APM

Following the step by step microservice development guide, we’ll learn how to use proto files to scaffold your microservice, as well as how to use SQL-first code generation for our required data structures. We’ll implement a Twitch RPC API with the minimal possible development effort, which will be focused on the ease of development for the final service.

When you finish with the exercises in this book, you will have a solid framework for microservice development and you can just keep adding new microservices to the mix.

How should I study it?

Just go through the book from the start to finish. If possible, try to do the exercises yourself not by copy pasting but by actually writing the code and snippets in the book, tailored to how you would lay out your project.

The work in individual chapters builds on what was done in the previous chapter. The examples are part of a step by step, chapter by chapter process, where we are developing the layout of the microservice, and implementing technical requirements for all future microservices.

Be sure to follow the Requirements section as you’re working with the book.