Event-carried state transfer

As we discussed here in a previous post, the use of event notifications allows us to develop elegant solutions to solve potentially complex problems.

How can two or more applications (potentially services or microservices) that use data from a particular entity type work as an eventually consistent system, with minimal coupling, without overloading network and without introducing critical points of failure?

The answer to the above question, of course, is a resounding “it depends “.

Generally, having all applications use the same database is not the best choice. After all, this decision would make all systems operate in an extremely tightly coupled manner, hence can create problems as the software becomes large. In addition, the database itself would become a critical point of failure. it is the solution with the lowest development cost and seems “OK” in scenarios where the schema is stable and the application development team is the same.

Developing a service that operates as a “source of truth” for a particular entity type, being consumed by all other services, does not seem to be a very smart strategy either. After all, the coupling would not be due to the database schema, but to the service contract. In addition, the service would also be a critical point of failure (experiencing instability would compromise the system as a whole). Anyway, it would be “OK” if the volume of consumption were small.

The best strategy seems to have each service keeping a copy of the data it needs to work, at least for online operations. This would require more storage space (which costs little), but there would be no implications for external instabilities (no points of failure) and no unnecessary overhead on the structure, especially if the frequency of data modification is small. However, it is the most complex approach, and as we know, complexity always has a cost.

When we have data from an entity, replicated across multiple sources, we can ensure consistency through notification events, which are posted every time an entity is changed. These events would “carry” the updated data and, being “listened to” by all applications that need this data could serve as the source for the update without having to consult the source.

This approach is significantly more potent if triggered events carried the modification context (for example, AddressUpdated, SalaryIncreased, etc.). After all, not all services would have to keep “all” data from the entities of interest.

Importantly, this approach becomes quite complicated if more than one application or service operates as a modification interface for the same subset of data.

Have you used or considered using notification events to give data consistency across distributed systems? Have you come across the challenge indicated in this post?

Compartilhe este insight:

Comentários

Participe deixando seu comentário sobre este artigo a seguir:

Subscribe
Notify of
guest
0 Comentários
Inline Feedbacks
View all comments

AUTOR

Elemar Júnior
Fundador e CEO da EximiaCo atua como tech trusted advisor ajudando empresas e profissionais a gerar mais resultados através da tecnologia.

NOVOS HORIZONTES PARA O SEU NEGÓCIO

Nosso time está preparado para superar junto com você grandes desafios tecnológicos.

Entre em contato e vamos juntos utilizar a tecnologia do jeito certo para gerar mais resultados.

Insights EximiaCo

Confira os conteúdos de negócios e tecnologia desenvolvidos pelos nossos consultores:

Arquivo

Pós-pandemia, trabalho remoto e a retenção dos profissionais de TI

CTO Consulting e Especialista em Execução em TI
0
Queremos saber a sua opinião, deixe seu comentáriox
Oferta de pré-venda!

Mentoria em
Arquitetura de Software

Práticas, padrões & técnicas para Arquitetura de Software, de maneira efetiva, com base em cenários reais para profissionais envolvidos no projeto e implantação de software.

Muito obrigado!

Deu tudo certo com seu envio!
Logo entraremos em contato

Event-carried state transfer

Para se candidatar nesta turma aberta, preencha o formulário a seguir:

Event-carried state transfer

Para se candidatar nesta turma aberta, preencha o formulário a seguir:

Condição especial de pré-venda: R$ 14.000,00 - contratando a mentoria até até 31/01/2023 e R$ 15.000,00 - contratando a mentoria a partir de 01/02/2023, em até 12x com taxas.

Tenho interesse nessa capacitação

Para solicitar mais informações sobre essa capacitação para a sua empresa, preencha o formulário a seguir:

Tenho interesse em conversar

Se você está querendo gerar resultados através da tecnologia, preencha este formulário que um de nossos consultores entrará em contato com você:

O seu insight foi excluído com sucesso!

O seu insight foi excluído e não está mais disponível.

O seu insight foi salvo com sucesso!

Ele está na fila de espera, aguardando ser revisado para ter sua publicação programada.

Tenho interesse em conversar

Se você está querendo gerar resultados através da tecnologia, preencha este formulário que um de nossos consultores entrará em contato com você:

Tenho interesse nessa solução

Se você está procurando este tipo de solução para o seu negócio, preencha este formulário que um de nossos consultores entrará em contato com você:

Tenho interesse neste serviço

Se você está procurando este tipo de solução para o seu negócio, preencha este formulário que um de nossos consultores entrará em contato com você:

× Precisa de ajuda?