APIs vs Events in Microservices | Which one is better?

  Рет қаралды 4,783

Marco Lenzo

Marco Lenzo

Күн бұрын

Пікірлер: 13
@MarcoLenzo
@MarcoLenzo Жыл бұрын
Who's the winner? APIs or Events? Let me know what you use in your systems 🤓
@pavelernestonavarroguerrer7871
@pavelernestonavarroguerrer7871 Жыл бұрын
Excelent video, and you are right about the most important part: Materialized view was the only right answer that I got for a common client-service integrartion problem!
@MarcoLenzo
@MarcoLenzo Жыл бұрын
Thank you for sharing your feedback. I have to admit it is a solution not everyone appreciates, but in my own experience it is key to keep microservices decoupled and efficient in a system where events drive most of the integration.
@LukeDavoli
@LukeDavoli 7 ай бұрын
Marco, your videos are absolutely fantastic. You make this and many other topics so simple and easy to understand. I am so grateful you're doing what you're doing, thank you!
@MarcoLenzo
@MarcoLenzo 7 ай бұрын
Thank you very much Luke! Comments like this are fuel to make more videos 🙏
@READBOOKIQBAL
@READBOOKIQBAL 3 ай бұрын
Great stuff, really insightful. Keep this up !
@MarcoLenzo
@MarcoLenzo 3 ай бұрын
Thank you 🙏
@LawZist
@LawZist Жыл бұрын
love your vids! waiting for more advanced conncepts
@MarcoLenzo
@MarcoLenzo Жыл бұрын
Sure! If you'd like to see some topic in particular let me know 🙂
@bralabala
@bralabala 10 ай бұрын
great way to learn something new
@MarcoLenzo
@MarcoLenzo 10 ай бұрын
Thank you!
@opleno-dev
@opleno-dev 10 ай бұрын
Could materialized views create unnecessary risks in terms of consistency? E.g. the publisher changes something and the consumer stops receiving updates, misleading the client. Btw gracias for this pleasant afternoon watching your videos
@MarcoLenzo
@MarcoLenzo 10 ай бұрын
Yes, absolutely! There might be scenarios where strong consistency is more desirable than eventual consistency. As always, it depends a lot on what are your system requirements and the business it is meant to support. The main issue with strong consistency is that it is difficult to achieve if you intend to distribute your logic across different microservices. If you decide not to allow materialized views and store the information only at the source of truth, you will be forcing all other microservices that need that piece of information to have a hard dependency on the source of truth. Now you have another type of risk. You might be unable to perform operations in multiple services if the source of truth is offline, is experiencing issues, or there's a network partition. You might be tempted to introduce caching, but isn't a cache subject to become stale like a materialized view? I think the key is "defining well what are the responsibilities of your microservices". Within a microservice is way easier to maintain strong consistency, as it is in a monolithic application. If you identify well your subdomains, you will make sure that all functions and data are grouped in a cohesive way that will make it very easy to keep consistent where it matters. If you take the example of orders and logistics in an online shop, getting updates about the status of the package, it is not something that requires strict consistency with the order status. As long as we have no data loss on the message broker, we are guaranteed that at some point (eventually) those two subdomains will become consistent. You need to be able to spot these nuances in your business requirements to figure out what works best for you.
OAuth and OIDC Explained... (they are SIMPLER than you THINK)
13:16
Monolithic vs Microservice Architecture: Which To Use and When?
10:43
МЕНЯ УКУСИЛ ПАУК #shorts
00:23
Паша Осадчий
Рет қаралды 5 МЛН
УДИВИЛ ВСЕХ СВОИМ УХОДОМ!😳 #shorts
00:49
HARD_MMA
Рет қаралды 3,3 МЛН
Don't underestimate anyone
00:47
奇軒Tricking
Рет қаралды 21 МЛН
Players vs Pitch 🤯
00:26
LE FOOT EN VIDÉO
Рет қаралды 138 МЛН
Event-Driven Architecture (EDA) vs Request/Response (RR)
12:00
Confluent
Рет қаралды 172 М.
Event Sourcing and CQRS Explained |  When should you use them?
12:36
DDD Explained in 9 MINUTES | What is Domain Driven Design?
9:44
Marco Lenzo
Рет қаралды 44 М.
Microservices with Databases can be challenging...
20:52
Software Developer Diaries
Рет қаралды 96 М.
CloudEvents: One Event to Rule Them All
25:58
EDA Summit
Рет қаралды 2,3 М.
What is AsyncAPI?
7:22
IBM Technology
Рет қаралды 19 М.
МЕНЯ УКУСИЛ ПАУК #shorts
00:23
Паша Осадчий
Рет қаралды 5 МЛН