Microservices Gone Wild – Tech Dive Part 2

In this post, I’ll outline the program I’ll be using to demonstrate how microservices work. It’s written in go but it’s pretty straightforward. At the end of the series of posts I will upload all of these examples to github as well, in case anybody wants to poke at them.
The Program – Squariply
For demonstration purposes, I’ll be discussing a very simple program that is currently implemented in a monolithic fashion. I’ve called it squariply
for reasons that will momentarily become obvious.
Purpose
Squariply accepts two integers on the command line, calculates the product (i.e. multiplies the two numbers), then squares the resulting number before printing the final result out. Mathematically speaking, if the integers provided on the command line are a and b, the output will be equivalent to (a * b) ^ 2.
Monolithic Code
My extremely amateur go code looks like this:
package main
import (
"fmt"
"os"
"strconv"
)
func main() {
str_a := os.Args[1]
str_b := os.Args[2]
int_a, _ := strconv.Atoi(str_a)
int_b, _ := strconv.Atoi(str_b)
multiplyResult := int_a * int_b
squareResult := multiplyResult * multiplyResult
fmt.Printf("Result is %d\n", squareResult)
}For the purposes of clarity, Continue reading
It can get quite exciting when you start to think about network automation and what it can do for you and your network. Once you’ve automated everything you can instead focus on deep work to evolve your business. However this daydream can soon fade away as you start to think about the things you can’t automate, or at least don’t know how to do. Ivan Pepelnjak wrote a piece about