- How to effectively compose your business logic
- Slim your aggregates with Event Sourcing!
- Architecture Weekly Webinar #8 - Slim down your aggregates!
- Straightforward Event Sourcing with TypeScript and NodeJS
- Process Managers Made Simple - Chris Condron - EventSourcing 2021
- Architecture Weekly Wbinar #3 - Implementing Distributed Processes
- Saga and Process Manager - distributed processes in practice
- [Event-driven distributed processes by example](https://event-driven.io/en/event_driven_distributed_processes_by_exam
defmodule SimpleS3Upload do | |
@moduledoc """ | |
Dependency-free S3 Form Upload using HTTP POST sigv4 | |
https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html | |
""" | |
@doc """ | |
Signs a form upload. | |
The configuration is a map which must contain the following keys: | |
* `:region` - The AWS region, such as "us-east-1" |
defmodule Cmd.Command do | |
@moduledoc """ | |
Utility for command definition, wrapping a design pattern into code | |
For our commands we will used type_embedded_schema to design an in memory schema | |
which will be used for the command payload | |
As well as this we require the developer to implement a changeset/2 function | |
""" |
defmodule Mix.Tasks.InspectAggregate do | |
use Mix.Task | |
alias MyApp.EventStore | |
def run(args) do | |
Application.ensure_all_started(:eventstore) | |
_ = EventStore.start_link() | |
{opts, _} = |
defmodule EventStore.CategoryStreamLinker do | |
@moduledoc """ | |
Links streams from aggregate instances to their respective category streams. | |
example: events from stream_uuid of `contractors_contract-07c52787-da0c-444f-9783-5d380f7093f9` will be | |
linked to stream_uuid of `contractors_contract`. | |
""" | |
use Commanded.Event.Handler, | |
application: My.App, |
# The helper functions for the test module. To make it possible to import | |
# this helper module in the test module, define this module outside the context that uses it. | |
defmodule MyTest.Helpers do | |
@spec fake_params(Enumrable.t()) :: map | |
def fake_params(override \\ %{}) do | |
%{ | |
country: "jp", | |
phone_number: Faker.phone_number(), | |
locale: "ja", | |
company: "My Company", |
defmodule MyApp.AggregateCase do | |
@moduledoc """ | |
This module defines the test case to be used by aggregate tests. | |
""" | |
use ExUnit.CaseTemplate | |
using aggregate: aggregate do | |
quote bind_quoted: [aggregate: aggregate] do | |
@aggregate_module aggregate |
name: Elixir CI | |
on: push | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: |
Quote from Elixir Mix 63 - "063: Designing Elixir Systems With OTP with Bruce Tate and James Gray", starting at 01:03:13
"I've worked at a bunch of companies building web apps for a long time, and I keep seeing this same pattern, and it haunts me. In the web world, all we want is these long interactions with people, and we live in this stateless world. So what we do is, the first part of every request, we do thirty queries to re-establish the state of the world that we just forgot a few seconds ago after the last request. And then we go forward and make one tiny step forward, and then we forget everything again, so that when the next request comes in we can do thirty queries to put it all back and make one more tiny step. And I kept thinking, "there has to be a better way than this, right?"
And if you look at web advancements over the years, most of the things we're doing are