𝔖 Scriptorium
✦   LIBER   ✦

πŸ“

Advent of Go Microservices

✍ Scribed by Tit Petric


Publisher
Lean Publishing
Year
2020
Tongue
English
Leaves
148
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Writing good services in Go can be a challenge - you have to write out your database structures, unit and integration testing with CI to see what breaks, keep them updated with migrations, define your API endpoints and routing, update your documentation - all of these things keep you from building your service. Let's be smart about it.

✦ Table of Contents


Table of Contents
Introduction
About me
Who is this book for?
How should I study it?
Requirements
Linux and Docker
Go: Introduction to Protobuf: Messages
Protobufs and Go
Generating Protobuf Go code
Wrapping up
Go: Introduction to Protobuf: Services
Protobuf service definitions
Our microservice
Twitch RPC scaffolding
Go: Introduction to Protobuf: gRPC
Generating the gRPC scaffolding
Comparing the server side
Comparing the client side
Make: Dynamic Makefile targets
Building multiple targets with Go
Dynamic Makefile target for building RPC/Protobuf files
Building our services from cmd/
Bash: Poor mans code generation
Generating our service cmd/ folders
Generating the client for our service
Server implementation
Bash: Embedding files into Go
Planning database migrations
Poor mans file embedding
Go: Scaffolding database migrations
The migration API
Drone CI: Testing database migrations
Configuring Drone CI for database integration tests
Go: Database first struct generation
Database schema data structures and helpers
Querying information schema
Type conversions
Moving forward
Go: Generating database schema documentation
Updating the Go generators
Implementing a markdown output renderer
A caveat emptor about database migrations
Go: Dependency injection with Wire
The Go way
Runtime vs. compile time
Wire and dependency providers
Wire and dependency Injector
Docker: Building images with security in mind
Configuring Makefile targets
The basic Dockerfile image
Security implications of our docker image
Possible improvements
Go: implementing a microservice
The database schema
Improving the microservice environment
Implementing Push
Docker/Bash: Issuing requests against our microservice
The docker-compose file
Our first request
Go: Improving our database handling
Data source name - DSN
Multiple database connections
Updating database connections
Database connection retry
Migration improvements
Re-testing the bundled migrations
Go: Instrumenting the HTTP service with Elastic APM
Wrapping our existing handler
Logging errors too
Setting up ELK
Setting up APM
Configuring our sender
Reviewing ELK data
Go: Instrumenting the Database client with Elastic APM
Extending DB connection
Verifying it's working
Go: Stress testing our service
Setting up our stress test
Resolving detected errors
Removing context cancellation
Wrapping up
Go: Background jobs
Adding background jobs to our service
Do we really need Init?
The background job
Housekeeping
Verifying everything works
Go: Optimizing requests with a queue
The Queue
The Producer
The Consumer
Benchmarking
Notes and pitfalls


πŸ“œ SIMILAR VOLUMES


Microservices with Go
✍ Alexander Shuiskov πŸ“‚ Library πŸ“… 2022 πŸ› Packt Publising Pvt Ltd 🌐 English

Mastering the art of Go microservice development Key Features Helps to create and organize well-structured Go microservices Provides industry best practices and insights on Go microservice development tools, patterns, and solutions Covers hands-on Golang examples in each chapter Book Descri

Microservices with Go
✍ Alexander Shuiskov πŸ“‚ Library πŸ“… 2022 πŸ› Packt Publising Pvt Ltd 🌐 English

Mastering the art of Go microservice development Key Features Helps to create and organize well-structured Go microservices Provides industry best practices and insights on Go microservice development tools, patterns, and solutions Covers hands-on Golang examples in each chapter Book Descri

gRPC Microservices in Go
✍ HΓΌseyin Babal πŸ“‚ Library πŸ“… 2023 πŸ› Manning Publications 🌐 English

Build super fast and super secure microservices with the gRPC high-performance messaging protocol and powerful Go language. In gRPC Microservices in Go you’ll learn: β€’ Designing and implementing resilient microservice architecture β€’ Testing microservices β€’ Deploying microservices to the cloud