You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Transactional outbox and event audit records (#18)
* Update README 📚
* Event entity
* Create event when we create a Todo
* Refactor nuke function
* Create separate field for todo_id
* Create event when we delete a Todo
* Use xid rather than Dgraph uid in event table
* Use field constants
* Events store xid not Dgraph uid
* Fix event type and Dgraph type
This is a Todo List app built with [Dgraph](https://dgraph.io/)-backed [gRPC](https://grpc.io/) and [GraphQL](https://graphql.org/) APIs, combined with a [NextJS](https://nextjs.org/) + [Chakra-UI](https://chakra-ui.com/) powered front-end.
Protocol buffers are a great choice for a language-neutral representation
38
+
39
+
Protocol buffers are a great choice for a language-neutral representation
17
40
of your data models.
18
41
19
42
They are binary, lean, and fast to serialize when compared with JSON.
20
43
21
-
Their extensibility comes from the fact that you can
44
+
Their extensibility comes from the fact that you can
22
45
add or remove fields in a way while maintaining backwards compatibilty.
23
46
24
47
Code generation makes it easy to generate your models in any language.
25
48
26
49
#### gRPC
27
-
gRPC is a lean transport system (typically paired with HTTP/2) meant to
50
+
51
+
gRPC is a lean transport system (typically paired with HTTP/2) meant to
28
52
reduce latency and payload size.
29
53
30
54
HTTP/2 allows for long-lived connections (fewer handshakes).
@@ -34,11 +58,13 @@ Unlike REST, gRPC uses an HTTP POST method for all calls, and doesn't specify th
34
58
gRPC is also binary, so it's not as easy to debug than something human-readable, like GraphQL. But it is excellent for internal calls between microservices.
35
59
36
60
#### GraphQL
61
+
37
62
GraphQL is an ideal query language for APIs, especially when consumed by web clients. It's typically human-readable (JSON). Clients can specify exactly which fields they want. GraphiQL is an amazing tool for gaining insight into what an API offers.
38
63
39
64
It also can make you think about your data as a graph.
40
65
41
66
#### Dgraph
67
+
42
68
Dgraph is a popular open-source, fast, distributed graph database written in Golang.
43
69
You get high throughput and low latency for deep joins and complex traversals.
44
70
It offers a query language that is a superset of GraphQL.
@@ -50,25 +76,31 @@ Performance: SQL performance suffers the more joins you ask it to do.
50
76
Flexibility / Complexity: Like NoSQL, the schema can be modified easily with time. Adding new relationships is as simple as adding a predicate. No need to create join tables. Ultimately, the graph model is more simpler / more intuitive.
51
77
52
78
#### Sqlboiler
53
-
It's not currently used in this project, but it's worth mentioning [Sqlboiler](https://github.com/volatiletech/sqlboiler)
54
-
since I believe it is by far the best SQL ORM for Golang due its "data-first"
55
-
approach: it auto-generates Go code based on your existing schema and as a
79
+
80
+
It's not currently used in this project, but it's worth mentioning [Sqlboiler](https://github.com/volatiletech/sqlboiler)
81
+
since I believe it is by far the best SQL ORM for Golang due its "data-first"
82
+
approach: it auto-generates Go code based on your existing schema and as a
56
83
result you get extreme type safety.
57
84
58
85
For services that aren't expected to have a whole lot of data relationships, SQL is still an excellent choice, and sqlboiler is an ideal ORM for keeping your persistence layer code strongly typed.
59
86
60
87
#### Meilisearch
88
+
61
89
We use [MeiliSearch](https://www.meilisearch.com/) as our "open source, blazingly fast and hyper relevant search-engine."
62
90
63
91
Per their site, MeiliSearch is effective and accessible:
64
-
> Efficient search engines are often only accessible to companies with the financial means and resources necessary to develop a search solution adapted to their needs. The majority of other companies that do not have the means or do not realize that the lack of relevance of a search greatly impacts the pleasure of navigation on their application, end up with poor solutions that are more frustrating than effective, for both the developer and the user.
92
+
93
+
> Efficient search engines are often only accessible to companies with the financial means and resources necessary to develop a search solution adapted to their needs. The majority of other companies that do not have the means or do not realize that the lack of relevance of a search greatly impacts the pleasure of navigation on their application, end up with poor solutions that are more frustrating than effective, for both the developer and the user.
The problem: developers will not bother with running CI tests and integration tests locally; instead they'll push to their GitHub PR and let the CI system take care of it.
73
105
74
106
Not only are they deprived of a production-like system on their local machines, but the feedback loop is too slow: having CircleCI run all the end-to-end tests takes too long.
@@ -78,4 +110,5 @@ Not only are they deprived of a production-like system on their local machines,
78
110
For shops with hundreds or thousands of microservices, I can see the argument that it's excessive (or even impossible) to run the whole system on your local machine. That said, maybe there's a term for a subset of services that are related, and maybe it's worth running those on Garden.
79
111
80
112
#### Change Data Capture
81
-
In a distributed system, when events occur in one service, they need to eventually be broadcast to other services. Too often, I've seen an event get emitted inside a database transaction, regardless of whether that transaction succeeds or fails. The [transactional outbox](https://microservices.io/patterns/data/transactional-outbox.html) pattern offers a way to keep data across services in sync.
113
+
114
+
In a distributed system, when events occur in one service, they need to eventually be broadcast to other services. Too often, I've seen an event get emitted inside a database transaction, regardless of whether that transaction succeeds or fails. The [transactional outbox](https://microservices.io/patterns/data/transactional-outbox.html) pattern offers a way to keep data across services in sync.
0 commit comments