index

Symbols

$PASSWORD variable 171

Numerics

2PC (two-phase commit) 18

A

actors, in hexagonal architecture 48

adapters

implementing 5457

in hexagonal architecture 4849

payment

implementing 7172

overview 6970

using in gRPC 7375

ALTS (Application Layer Transport Security) 6

api package 52

API server 132

APIPort interface 53, 74

app:order label 138

app:payment label 138

application core, implementing 5153

application logging 168169

Application struct 53

applications

in hexagonal architecture 48

running 6163

automatic mock generation 111112

automation, for source code generation 4042

average value of numbers 156

B

BackoffExponentialWithJitter option 87

BackoffLinearWithJitter option 87

backward compatibility 4345

adding new fields 43

adding/removing oneof fields 4445

moving fields out of or into oneof fields 45

upgrading client but not server 44

upgrading server but not client 4344

bidirectional streaming 6, 27

blue-green deployment 146147

C

CA (certificate authority) 97

Called() method 109

canary deployment 144, 147

cancellation function 84

CD (continuous deployment) pipeline 127

cert pool 99

certificate authority (CA) 97

certificate generation 9798

certificate management 141144

certificate usage in Ingress 143

certificates on client side 144

ClusterIssuer 142143

installation 142

CertificateRequests CRD 142

Certificates CRD 142

Challenges CRD 142

Charge method 72

choreography-based saga 1921

CI/CD pipeline

production-grade use cases 11

testing in 124

circuit breaker pattern 8792

client

certificates on side of 144

configuration for payment stub 7273

handling errors on side of 7879

load balancing on side of 6768

upgrading client but not server 44

upgrading server but not client 4344

client-side load balancing 66

CLIs (command-line interfaces) 48

cluster level logging 158

ClusterIP type 137

ClusterIssuer 142143

ClusterIssuers CRD 142

code generation 5

command channel notation 21

command-line interfaces (CLIs) 48

connecting wires, in interservice communication 2728

container runtime 1011

context function 84

context.Background() parent context 84

continuous deployment (CD) pipeline 127

control plane 130

-cover parameter 111, 123

coverage, test 123124

coverage information 123124

testing in CI pipeline 124

coverage.out report 124

-coverprofile param 111

CRDs (custom resource definitions) 141142

Create endpoint 5960, 74, 7678, 120

Create function 24

Create method 37, 60, 68, 72

CreateOrder request 63

CreateOrderRequest message 3233

CreatePaymentRequest message 24, 35

CreatePaymentResponse message 24

ctx parameter 28

custom resource definitions (CRDs) 141142

D

-d parameter 63

data consistency, handling in microservice architecture 18

database layer, end-to-end tests 117118

db call 108

db.Get() function verification 114

db.Save() testing 114

dependency injection 6163

deployment 127149

certificate management 141144

certificate usage in Ingress 143

certificates on client side 144

ClusterIssuer 142143

installation 142

Docker 128130

Kubernetes 130141

architecture 130132

deployment 135137

eagle view of microservices deployment 133134

NGINX Ingress controller 140141

pod 134

resources 132133

Service resource 137139

of monolithic applications 1516

strategies for 144149

blue-green deployment 146147

canary deployment 147

final thoughts on deployment 148149

RollingUpdate 145146

Docker 128130

Docker Compose service definitions 116117

docker login command 130

docker-compose up operation 121

driven actor 48

driver actor 48

E

Elasticsearch, as logging backend 170172

ELK stack (Elasticsearch-Logstash-Kibana) 158

encoding, protocol buffer 3336

end-to-end tests 115123

database layer 117118

Docker Compose service definitions 116117

folder structure for 117

Order service layer 119120

Payment service layer 118119

running tests against stack 120123

specifications 116

enums 24

error handling

and resilient communication 9295

gRPC error model 93

gRPC error response 9395

in interservice communication 7580

errors with details 7778

handling errors on client side 7879

returning error code and message 7677

running Payment service 80

status codes 7576

error message, gPRC 75

ErrorDetails section 93

F

fault tolerance 56

Fibonacci function 106

field names 32

field numbers 33

field rules 32

field types 32

fields

adding new to messages 43

moving out of or into oneof fields 45

folders

project 5051

structure for end-to-end tests 117

Format function 168

forward compatibility 4345

adding new fields 43

adding/removing oneof fields 4445

moving fields out of or into oneof fields 45

upgrading client but not server 44

upgrading server but not client 4344

FROM keyword 128

G

Get endpoints 120

Get method 54, 5657

go build command 128

go mod init command 51

Go source code, generating 2527

go test command 106

gorm.DB reference 56

gRPC adapter, implementing 5761

gRPC endpoint, calling 6364

gRPC error model 93

gRPC error response 9395

gRPC microservices 328

audience for book 8

benefits of 46

code generation and interoperability 5

fault tolerance 56

performance 4

security 6

streaming 6

microservice architecture 1722

choreography-based saga 1921

handling data consistency 18

orchestration-based saga 2122

saga pattern 1819

monolithic architecture 1516

deployment 1516

development 15

scaling 16

production-grade use cases 813

CI/CD pipeline 11

container runtime 1011

microservices 910

monitoring and observability 1112

public access 1213

REST vs. RPC 67

scale cube 1617

X-axis scaling 16

Y-axis scaling 17

Z-axis scaling 17

service discovery 22

when to use 78

gRPC service-to-service communication 6668

grpc_retry package 87

grpcurl command 58, 144

H

hexagonal architecture

Order service implementation 4964

calling gRPC endpoint 6364

dependency injection and running application 6163

implementing adapters 5457

implementing application core 5153

implementing gRPC adapter 5761

implementing ports 5354

initializing Go project 51

project folders 5051

overview 4749

-html option 124

I

idempotent operations 6

IDL (Interface Definition Language) 5

images, Docker 128130

-import-path parameter 144

Ingress

certificate usage in 143

NGINX Ingress controller 140141

init() function 168169

initializing Go project 51

installation

cert-manager 142

Jaeger 162163

instrumentation, OpenTelemetry 159

int type 33, 35

int64 type 52

integration tests 112115

test suite preparation 112113

working with Testcontainers 113115

internal/adapters/grpc package 73

interoperability 5

interservice communication 3146, 6580

backward and forward compatibility 4345

adding new fields 43

adding/removing oneof fields 4445

moving fields out of or into oneof fields 45

upgrading client but not server 44

upgrading server but not client 4344

depending on module and implementing ports and adapters 6875

client configuration for payment stub 7273

implementing payment adapter 7172

implementing payment port 70

payment adapter overview 6970

payment port overview 69

using payment adapter in gRPC 7375

error handling 7580

errors with details 7778

handling errors on client side 7879

returning error code and message 7677

running Payment service 80

status codes 7576

generating stubs 3638

gRPC service-to-service communication 6668

maintaining .proto files 3842

automation for source code generation 4042

proto project structure 3840

protocol buffers 3236

defining message type 3233

protocol buffer encoding 3336

using gRPC for 2328

connecting wires 2728

generating Go source code 2527

working with protocol buffers 2425

IP:port pair 138

Issuers CRD 142

J

Jaeger All in One 161162

Jaeger installation 162163

jaeger namespace 162

jaeger pod 165

Jaeger SPM (service performance monitoring) component 167

jaeger-prometheus Prometheus service name 162

K

Kibana as logging dashboard 172174

kubectl apply command 136

kubectl command-line tool 132

Kubernetes

deployment 130141

architecture 130132

eagle view of microservices deployment 133134

NGINX Ingress controller 140141

overview 135137

pod 134

resources 132133

Service resource 137139

observability in 161174

application logging 168169

Elasticsearch as logging backend 170172

Jaeger All in One 161162

Jaeger installation 162163

Kibana as logging dashboard 172174

logs collection 169170

OpenTelemetry Collector 162

OpenTelemetry interceptor for Order service 163165

Prometheus 162

understanding metrics of Order service 165167

L

labels section 136

latest tag 39

load balancing

client-side 6768

server-side 66

LoadBalancer Service type 137140, 144

.local domain name 143

logging

application 168169

Elasticsearch as backend for 170172

in observability 157158

Kibana as dashboard for 172174

log collections 169170

M

math class 106

message fields 43

metrics

and OpenTelemetry 159160

in observability 155157

of Order service, understanding 165167

microservice architecture 1722

choreography-based saga 1921

handling data consistency 18

orchestration-based saga 2122

production-grade use cases 910

saga pattern 1819

microservice project setup 4764

hexagonal architecture 4749

Order service implementation 4964

calling gRPC endpoint 6364

dependency injection and running application 6163

implementing adapters 5457

implementing application core 5153

implementing gRPC adapter 5761

implementing ports 5354

initializing Go project 51

project folders 5051

minikube tunnel command 143144

mocks

automatic generation of 111112

implementing 108111

working with 107108

modules, depending on 6875

client configuration for payment stub 7273

implementing payment adapter 7172

implementing payment port 70

payment adapter overview 6970

payment port overview 69

using payment adapter in gRPC 7375

monitoring 1112

monolithic architecture 1516

deployment 1516

development 15

scaling 16

mTLS (mutual TLS) 96

multistage builds 118, 128

N

New<Service_Name>Client naming convention 28

New<ServiceName>Client function 37

NewAdapter function 56

NewApplication method 53

NewOrder method 52

NewOrderClient(...) function 37

NGINX Ingress controller 140141

nginx instance 134, 141

nginx-ingress chart 141

nginx.conf. NGINX configurations 141

node-level logging 157158

NodePort option 141

NodePort service type 137139

numbers, average value of 156

O

observability 153174

in Kubernetes 161174

application logging 168169

Elasticsearch as logging backend 170172

Jaeger All in One 161162

Jaeger installation 162163

Kibana as logging dashboard 172174

logs collection 169170

OpenTelemetry Collector 162

OpenTelemetry interceptor for Order service 163165

Prometheus 162

understanding metrics of Order service 165167

logs 157158

metrics 155157

OpenTelemetry 158161

instrumentation 159

instrumentation locations 159

metric backend 159160

service performance monitoring 160161

production-grade use cases 1112

traces 154155

OK status 75

oneof fields

adding/removing 4445

moving fields out of or into 45

OpenTelemetry 158161

instrumentation 159

instrumentation locations 159

metric backend 159160

service performance monitoring 160161

OpenTelemetry Collector 162

OpenTelemetry interceptor for Order service 163165

orchestration-based saga 2122

Order data 19, 52

Order event 21

Order model 5456, 60, 69

order operation 84

Order service 3940, 42

end-to-end tests 119120

implementation 4964

calling gRPC endpoint 6364

dependency injection and running application 6163

implementing adapters 5457

implementing application core 5153

implementing gRPC adapter 5761

implementing ports 5354

initializing Go project 51

project folders 5051

OpenTelemetry interceptor for 163165

understanding metrics of 165167

order_created event 20

order-service, deployment 135

Order:create() method 18

OrderClient interface 37

OrderDatabaseTestSuite type 113114

OrderId struct 55

OrderItem model 54

Orders CRD 142

orders database 118

ORM (Object Relational Mapping) library 54

otelgrpc package 164

outputs section 171

P

payment adapter

implementing 7172

overview 6970

using in gRPC 7375

Payment Create operation 166

Payment operation 18

payment port

implementing 70

overview 69

Payment service 3940, 42

calls 108

end-to-end tests 118119

running 80

payment stub, client configuration for 7273

payment_created event 20

payment_failed event 20

payment-related calls 108

payment.Charge() call 110

payments database 118

PENDING state 20, 74

performance benefits of gRPC microservices 4

PlaceOrder 5253, 59, 74, 78, 107109, 154, 161

-plaintext parameter 63

pods, Kubernetes 134

ports

implementing 5354

in hexagonal architecture 48

payment

implementing 70

overview 69

ports.DBPort interface 52

PR (pull request) 124

production-grade use cases 813

CI/CD pipeline 11

container runtime 1011

microservices 910

monitoring and observability 1112

public access 1213

project folders 5051

project structure, proto 3840

Prometheus 162

promo_code option 45

-proto file 144

.proto files, maintaining 3842

automation for source code generation 4042

proto project structure 38

protocol buffer compiler 25

installation 36

using 3638

protocol buffers 3236

defining message type 3233

encoding 3336

in interservice communication 2425

public access 1213

R

replicas definition 136

replyTo channel 21

replyToChannel parameter 20

reserved keyword 33

resilient communication 81102

error handling 9295

gRPC error model 93

gRPC error response 9395

resiliency patterns 8292

circuit breaker pattern 8792

retry pattern 8587

timeout pattern 8285

securing gRPC communication 95101

certificate generation 9798

gRPC TLS credentials 99101

TLS handshake 9596

ResourceExhausted response code 8687

REST (Representational State Transfer) 67

retry pattern 8587

RollingUpdate deployment 145146

round-robin algorithm 67

route operation 141

RPC (Remote Procedure Call) 67

Run method 62

running application 6163

S

saga pattern

choreography-based saga 1921

orchestration-based saga 2122

overview 1819

Save method 54, 5657

scale cube 1617

X-axis scaling 16

Y-axis scaling 17

Z-axis scaling 17

scaling monolithic applications 16

SDKs (software development kits) 79

server

load balancing on side of 66

upgrading client but not server 44

upgrading, but not client 4344

service discovery 22

service performance monitoring 160161

Service resource, Kubernetes 137139

Service types 137

Service YAML definition 137

service-level agreement (SLA) 155

service-level indicator (SLI) 155

service-level objective (SLO) 155157

service-to-service communication 6668

Service, LoadBalancer Type 137

<ServiceName>Client function 37

Service – pod relationship 147

SetupSuite section 120

Shipping operation 18

Shipping service 3940, 42

Shipping stub 24

SLA (service-level agreement) 155

SLI (service-level indicator) 155

SLO (service-level objective) 155157

software development kits (SDKs) 79

source code generation automation 4042

spec section 136

stack, running tests against 120123

status codes, in error handling 7576

stubs

client and server 4

generating 3638

Payment and Shipping 24

payment, client configuration for 7273

-subj parameter 97

SUT (system under test) 105

svc.cluster.local suffix 162

T

TearDownSuite 120, 122

test suite preparation 112113

Testcontainers 113115

testing microservices 103126

end-to-end tests 115123

database layer 117118

Docker Compose service definitions 116117

folder structure for 117

Order service layer 119120

Payment service layer 118119

running tests against stack 120123

specifications 116

integration tests 112115

test suite preparation 112113

working with Testcontainers 113115

test coverage 123124

coverage information 123124

testing in CI pipeline 124

testing pyramid 104105

unit tests 105112

automatic mock generation 111112

implementing mock 108111

system under test 105

test workflow 106107

working with mocks 107108

testing pyramid 104105

TestSetupSuite function 113

TestSetupTest method 112

TestTearDownSuite method 112

timeout pattern 8285

TLS (Transport Layer Security) 4

gRPC credentials 99101

handshake 9596

to keyword 33

traces, in observability 154155

two-phase commit (2PC) 18

U

UAT (user acceptance testing) 11

Unavailable response code 8687

unit tests 105112

automatic mock generation 111112

implementing mock 108111

system under test 105

test workflow 106107

working with mocks 107108

upgrading

client, but not server 44

server, but not client 4344

V

VCS (Version Control System) 11

W

wires, connecting in interservice communication 2728

WithBackoff configuration 87

WithCodes configuration 87

WithMax configuration 87

WithStreamingInterceptor interceptor usage 87

WithUnaryInterceptor interceptor usage 87

worker nodes 130

X

X-axis scaling 16

Y

Y-axis scaling 17

Z

Z-axis scaling 17