Skip to content

WhitneyLampkin/proglog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Proglog


Auto-generated by the devscriber command-line tool.

GitHub language count GitHub contributors GitHub repo size GitHub repo file count (file type)

This GitHub repo has code examples from the Distributed Services with Go O'Reilly book by Travis Jeffrey.

Initial Setup

After cloning the repo, run the following:

make init
make gencert
make compile

Usage

To run the program's API, execute the command below from proglog/cmd/server:

$ go run main.go

POST new records to the log:

$ curl -X POST localhost:8080 -d '{"record": {"value": "TGV0J3MgR28gIzEK"}}'
​$ curl -X POST localhost:8080 -d '{"record": {"value": "TGV0J3MgR28gIzIK"}}'
$ curl -X POST localhost:8080 -d '{"record": {"value": "TGV0J3MgR28gIzMK"}}'

GET records from the log:

 curl -X GET localhost:8080 -d '{"offset": [RECORD_OFFSET_#]}'

Testing

make test

Features

The project's features are as follows:

⭐ Chapter 1: JSON/HTTP commit log service that stores and retrieves records from an in-memory log.
⭐ Chapter 2: Protobuf fundamentals and using them to create a protocol buffer for the Record type.
⭐ Chapter 3: Writing a custom log package
⭐ Chapter 4: Serve Requests w/ gRPC
⭐ Chapter 5: Securing the Service w/ Mutual TLS Authentication
⭐ Chapter 6: Observing the System
⭐ Chapter 7: Adding Service Discovery
⭐ Chapter 8: Implementing Raft
⭐ Chapter 9: Discover Servers and Load Balance from the Client

Notes

  • Chapter 5 uses go get to install the cfssl tools. If this doesn't work, I recommend using sudo apt install golang-cfssl and sudo apt install golang-cfssljson.
  • Observability - a measure of how well we understand a system's behavior or state based on external outputs.
  • Types of Telemetry
    1. Metrics - measure numeric data over time (counters, histograms, gauges).
      • Google's 4 Golden Signals - latency, errors, traffic, saturation (L.E.T.S.).
    2. Structured logs - descriptions of events that have occurred in a system.
    3. Traces - details the request lifecycle as it flows through the system.
  • Chapter 9: Load balancing strategies
    1. Server Proxying image
    2. External Load Balancing image
    3. Client-side Balancing image

License

None

About

Examples from the Distributed Services with Go by Travis Jeffery

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published