-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoc.go
More file actions
36 lines (31 loc) · 1.6 KB
/
doc.go
File metadata and controls
36 lines (31 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
Module "hs.ir/r2/basic" (r2basic) provides basic functionality used to implement
a backend microservice in a microservices ecosystem.
Backend microservice has a dedicated PostgreSQL database
and provides its services through gRPC.
It can also call other microservices using gRPC.
gRPC dependency between microservices must be a loopless graph.
External clients (browser, mobile, ...) can't directly call backend microservices;
but they can call Gateway.
Gateway is a server process that exposes REST APIs to clients.
When a gateway API is called, it calls backend microservice(s) by gRPC
and returns the result.
Gateways are part of our architecture; however they are out of r2basic scope.
Basic microservice functionalities covered in r2basic are:
- Database connection and usage
- gRPC service exposure (as server)
- gRPC service call (as client)
- Asynchronous + Transactional job execution
(helps implementing: Long-running jobs, Scheduled jobs, Saga pattern, ...)
- Container-compatible (Kubernetes-compatible) features: Server lifecycle, Logger, ...
- Eventually-consistent in-memory cache
- Test-driven development (TDD): Persistent database fixture, ...
- Clustering: Multiple load balanced same-microservice instances, sharing database
DB-less microservices (shouldn't be confused with DBLess architecture)
are some specific (but very rare) kind of microservices
that can be implemented using r2basic.
They have no database.
Therefore, they don't have database-dependent features (like Job).
However other features like gRPC communication work.
*/
package basic