evdzhurov / dist-services-with-go

Coding exercises from the book "Distributed Services with Go" by Travis Jeffrey, March 2021, ISBN: 9781680507607
3 stars 0 forks source link

dist-services-with-go

Coding exercises and notes from the book "Distributed Services with Go" by Travis Jeffrey, March 2021, ISBN: 9781680507607

Book Errata

Part I - Get Started

Building basic elements: storage layer, defining data structures.

Install latest Go

Chapter 1 - Creating an http server with an append-only log service

A simple JSON over HTTP commit log service.

Chapter 2

Set up protocol buffers, generate data structures, set up automation.

Chapter 3

Build a commit log library as the core of the service for storing and retrieving data.

Store

Index

Segment

Log

Part II - Network

Make services work over a network.

Chapter 4

Set up gRPC, define our server and client APIs, build client and server.

Chapter 5

Secure connections by authenticating with SSL/TLS and using access tokens.

Mutual (two-way) TLS authentication

Authorize with Access Control Lists (ACL)

Chapter 6

Make our service observable by adding logs, metrics and tracing.

Part III - Distribute

Make our service distributed, highly available, resilient and scalable.

Chapter 7

Build discovery into our service and make server instances aware of each other.

Chapter 8

Add consensus to coordinate our servers and turn them into a cluster.

Discovery Integration

Test the Distributed Log

Multiplex to Run Multiple Services on One Port

Many distributed services that use Raft multiplex Raft with other services like an RPC service.

Chapter 9

Add discovery in our gRPC clients so they can connect to the server with client-side load balancing.

Make Servers Discoverable

Resolve the Servers

Route and Balance Requests with Pickers

In the gRPC architecture pickers perform request-routing logic.

Part IV - Deploy

Deploy our service and make it live.

Chapter 10

Set up Kubernetes locally and run a cluster on your machine. Prepare to deploy on the Cloud.

Write an Agent Command-Line Interface

Build Docker Image

Configure and Deploy the Service With Helm

Container Probes and gRPC Health Check

Kubernetes Services

Advertise Raft on the Fully Qualified Domain Name

Install the Helm Chart

Request the service from a program running outside the kubernetes cluster

Chapter 11

Create a Kubernetes cluster on Google Cloud's Kubernetes Engine and deploy our service to the Cloud.

Push the services image to Google's Container Regestry (GCR)

Create Custom Controllers With Metacontroller

Metacontroller is a Kubernetes add-on that makes it easy to write and deploy custom controllers with simple scripts.

Add Service-per-Pod Load Balancer Hooks

Deploy to the Internet

helm install proglog proglog --set image.repository=gcr.io/$PROJECT_ID/proglog --set service.lb=true
./test-getservers-cloud.sh