In order to use
FactCast effectively it is necessary to have an overview of the concepts and to understand how
FactCast might differ from other solutions you are already familiar with. So let's take a look at the basics:
FactCast you can publish
Facts which will be written into a log. You can publish a single
Fact as well as a list of
Facts atomically (all-or-none).
With optimistic locking you can use conditional publishing, which is based upon aggregates that do not change during the lifecycle of the lock (see optimistic locking).
In order to receive
Facts you have to subscribe to
FactCast with a subscription request. This is where
FactCast significantly differs from other solutions because the subscription request contains the full specification of what events to receive. This means that no server-side administration is needed, nor any prior knowledge about the streams where to publish the
role="alert"> TODO see
In addition to the specification of events to read, the
SubscriptionRequest also specifies the events to skip (e.g. due to previous consumption). The request also defines how to deal with
Facts being published in the future.
role="alert"> Note that
Facts are always guaranteed to be sent in the order they were published.
The three usual subscription models and their corresponding use cases are:
|Follow||This covers the 80% of the use cases. Here the consumer catches up with
|Catchup||This subscription catches up with past events but does not receive any new
|Ephemeral||The consumer does not catch up with past events, but receives matching
All these subscription types rely on a streaming transport which uses (at the time of writing) GRPC.
In some situations the bandwidth of the consumption has to be reduced. This can happen if either there are too many consumers interested in the same
Fact or consumers keep receiving the same
Facts (e.g. catchup subscriptions without snapshotting). Pushing only ‘ids’ (or URLs) instead of complete
Facts can improve the performance. Depending on the protocol being used HTTP-Proxies or local caches can also be applied for further performance enhancement.