In this recipe, we implement a command function that would be part of a Backend For Frontend service. Following the Event Sourcing pattern, we make this command atomic by only writing to a single resource. In many scenarios, such as the authoring of data, we need to write data and make sure it's immediately available for reading. In these cases, the database-first variant is most appropriate. The command just needs to execute quickly and leave as little to chance as possible. We write the domain object to the highly available, fully-managed cloud-native database and trust that the database's change data capture mechanism will handle the next step.
In this recipe, the database is DynamoDB and the change data capture mechanism ...