Skip to content

Commit 4703b71

Browse files
committed
More typo stuff
1 parent c81f462 commit 4703b71

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/pages/blog/tour.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ heroImage: 'nrepl.jpg'
1919

2020
I'm currently writing some blog posts about Event Driven Architecture. As part of this series, I recreate some of the key concepts/features in Clojure without using external services.
2121

22-
Serendipitously, in the latest Juxt Safari 🐘 session (our internal tech talks), Hak and Jeremy presented Trip: the just released library providing datalog in a name-space.
22+
Serendipitously, in the latest Juxt Safari 🐘 session (our internal tech talks), Hak and Jeremy presented Trip: the just-released library providing datalog in a name-space.
2323

2424
For my demo code, I needed:
2525

2626
- an easy local way to store events for a data sourcing example i.e an event-store,
27-
- a way to store records for a topic on a message bus i.e a log-store (using Kafka's terminology for the storage abstraction).
27+
- a way to store records for a topic on a message bus i.e. a log-store (using Kafka's terminology for the storage abstraction).
2828

2929
A perfect opportunity to have a play with Trip as the underlying, but local, back-end 🙂.
3030

@@ -192,9 +192,9 @@ and
192192

193193
Pretty neat all thanks to Trip 😎
194194

195-
Note that we use a transaction function in to call append - the reason being thread safety. By default Trip implements its connection as an atom. The append function itself uses the database to discover the latest offsets - if we dereference the connection to get the value and the overall transact retries, then the value may have changed in a competing thread.
195+
Note that we use a transaction function to call append - the reason being thread safety. By default Trip implements its connection as an atom. The append function itself uses the database to discover the latest offsets - if we dereference the connection to get the value and the overall transact retries, then the value may have changed in a competing thread.
196196

197-
It's pretty great we can do this as we explore easily some of the issues seen with partitioning of topics in Kafka. The below test shows different client threads saving to the event-store. Thanks to Clojure atom's isolation properties we will always have a consistent state file. However, we won't actually know which thread wins out and the overall final ordering of the saved documents (we do know a partitions total order). Precisely the problems encountered when working with Kafka partitions.
197+
It's pretty great we can do this as we explore easily some of the issues seen with the partitioning of topics in Kafka. The below test shows different client threads saving to the event-store. Thanks to Clojure atom's isolation properties we will always have a consistent state file. However, we won't actually know which thread wins out and the overall final ordering of the saved documents. Precisely the problems encountered when working with Kafka partitions.
198198

199199
```clojure
200200
(deftest eventstore-isolation-negative-test
@@ -214,7 +214,7 @@ It's pretty great we can do this as we explore easily some of the issues seen wi
214214

215215
## Retrieval
216216

217-
Getting the data back out requires some Datalog to pull the documents and some post sorting in Clojure.
217+
Getting the data back out requires some Datalog to pull the documents and some post-sorting in Clojure.
218218

219219
```clojure
220220
(->> (trip/q '{:find [(pull ?e [*])]
@@ -230,7 +230,7 @@ Getting the data back out requires some Datalog to pull the documents and some p
230230
(mapv #(dissoc % :db/id :offset)))
231231
```
232232

233-
Tour's `gen-datalog` macro and a helper function aids in the construction of the queries based off of the components of the composite key. The macro generates the Datalog query and the helper function does a post query transform to tidy things up.
233+
Tour's `gen-datalog` macro and a helper function aid in the construction of the queries based on the components of the composite key. The macro generates the Datalog query and the helper function does a post-query transform to tidy things up.
234234

235235
```clojure
236236
(defmacro gen-datalog
@@ -256,7 +256,7 @@ Tour's `gen-datalog` macro and a helper function aids in the construction of the
256256
nil))))))
257257
```
258258

259-
The macro is passed an `offset-type` which is a keyword representing its namesake Clojure operation e.g. `:nthrest` provides all documents after an offset, `:take` before.
259+
The macro is passed an `offset-type` which is a keyword representing its namesake Clojure operation e.g.`:nthrest` provides all documents after an offset, `:take` before.
260260

261261
And the post-query transform is simply
262262

@@ -273,7 +273,7 @@ And the post-query transform is simply
273273

274274
## Trivial Read Functions
275275

276-
For the example blog code we can now write our respective read functions as easily as the write functions.
276+
For the example blog code, we can now write our respective read functions as easily as the write functions.
277277

278278
For the event-store we need to return in order all events for a particular aggregate and remove the offset.
279279

@@ -285,7 +285,7 @@ For the event-store we need to return in order all events for a particular aggre
285285
(mapv #(dissoc % :offset))))
286286
```
287287

288-
And for our message bus requirements we can mimic a poll which fetches a message at an offset and all after it (nthrest).
288+
And for our message bus requirements, we can mimic a poll that fetches a message at an offset and all after it.
289289

290290
```clojure
291291
(defn poll
@@ -296,9 +296,9 @@ And for our message bus requirements we can mimic a poll which fetches a message
296296

297297
## Trip's Protocol's To the Rescue
298298

299-
In DDD we might want our event-store to both save the events it receives and to publish those events to message bus in the same "transaction". This way we are assured that subscribers to the published events will be eventually consistent.
299+
In DDD we might want our event-store to both save the events it receives and publish those events to a message bus in the same "transaction". This way we are assured that subscribers to the published events will be eventually consistent.
300300

301-
Thankfully Trip supports changing out the underlying operations for a connection. The intention here is to allow people to extend Trip in new and interesting ways. Tour uses it to pivot to `refs` instead of `atoms` to manage connections. This way we can get transactional behaviour for free.
301+
Thankfully Trip supports changing out the underlying operations for a connection. The intention here is to allow people to extend Trip in new and interesting ways. Tour uses it to pivot to `refs` instead of `atoms` to manage connections. This way, via Clojure's native support for transactions, we have transactional behaviour for free.
302302

303303
```clojure
304304
(defn create-conn [] (ref (trip/empty-db)))
@@ -391,4 +391,4 @@ The following test exercises our implementation - saving event-a's to partition
391391
(logstore/poll (trip/db conn) "event-topic" 2 0))))
392392
```
393393

394-
One thing to note here is that we use a single document database to serve both our stores - echos of the ideas in Atomic Architecture.
394+
One thing to note here is that we use a single Trip database to serve both our stores - in line with the [shared state](https://www.juxt.pro/blog/atomic-architecture/) idea from Atomic Architecture.

0 commit comments

Comments
 (0)