emacsway-log: Software Design, Clean Architecture, DDD, Microservice Architecture, Distributed Systems, XP, Agile, etc.
Решение? 📝 "While not discussed in detail here, Message Metadata can be used to achieve causal consistency [AMC-Causal Consistency https://queue.acm.org/detail.cfm?id=2610533 ] among Messages (130) that must be replicated across a network with full ordering…
📝 "Note that just saving the Domain Event in its causal order doesn’t guarantee that it will arrive at other distributed nodes in the same order. Thus, it is also the responsibility of the consuming Bounded Context to recognize proper causality. It might be the Domain Event type itself that can indicate causality, or it may be metadata associated with the Domain Event, such as a sequence or causal identifier. The sequence or causal identifier would indicate what caused this Domain Event, and if the cause was not yet seen, the consumer must wait to apply the newly arrived event until its cause arrives. In some cases it is possible to ignore latent Domain Events that have already been superseded by the actions associated with a later one; in this case causality has a dismissible impact [об этом способе уже говорилось ранее, прим. моё]."
- "Domain-Driven Design Distilled" by Vaughn Vernon, Chapter "6. Tactical Design with Domain Events:: Designing, Implementing, and Using Domain Events"
📝 "The first option is to use message sessions, a feature of the Azure Service Bus. If you use message sessions, this guarantees that messages within a session are delivered in the same order that they were sent.
The second alternative is to modify the handlers within the application to detect out-of-order messages through the use of sequence numbers or timestamps added to the messages when they are sent. If the receiving handler detects an out-of-order message, it rejects the message and puts it back onto the queue or topic to be processed later, after it has processed the messages that were sent before the rejected message."
- "CQRS Journey" by Dominic Betts, Julián Domínguez, Grigori Melnik, Fernando Simonazzi, Mani Subramanian, Chapter "Journey 6: Versioning Our System :: Message ordering"
https://docs.microsoft.com/ru-ru/previous-versions/msp-n-p/jj591565(v=pandp.10)#message-ordering
📝 "Actors must be prepared to accept and reject messages based on their current state, which is reflected by the order in which previous messages were received. Sometimes a latent message could be accepted even if it is not perfect timing, but the actor’s reaction to the latent message may have to carefully take into account its current state beforehand. This may be dealt with more gracefully by using the actors become() capabilities."
- "Reactive Messaging Patterns with the Actor Model: Applications and Integration in Scala and Akka" by Vaughn Vernon, Chapter "5. Messaging Channels :: Point-to-Point Channel"
#DDD #Microservices #DistributedSystems
- "Domain-Driven Design Distilled" by Vaughn Vernon, Chapter "6. Tactical Design with Domain Events:: Designing, Implementing, and Using Domain Events"
📝 "The first option is to use message sessions, a feature of the Azure Service Bus. If you use message sessions, this guarantees that messages within a session are delivered in the same order that they were sent.
The second alternative is to modify the handlers within the application to detect out-of-order messages through the use of sequence numbers or timestamps added to the messages when they are sent. If the receiving handler detects an out-of-order message, it rejects the message and puts it back onto the queue or topic to be processed later, after it has processed the messages that were sent before the rejected message."
- "CQRS Journey" by Dominic Betts, Julián Domínguez, Grigori Melnik, Fernando Simonazzi, Mani Subramanian, Chapter "Journey 6: Versioning Our System :: Message ordering"
https://docs.microsoft.com/ru-ru/previous-versions/msp-n-p/jj591565(v=pandp.10)#message-ordering
📝 "Actors must be prepared to accept and reject messages based on their current state, which is reflected by the order in which previous messages were received. Sometimes a latent message could be accepted even if it is not perfect timing, but the actor’s reaction to the latent message may have to carefully take into account its current state beforehand. This may be dealt with more gracefully by using the actors become() capabilities."
- "Reactive Messaging Patterns with the Actor Model: Applications and Integration in Scala and Akka" by Vaughn Vernon, Chapter "5. Messaging Channels :: Point-to-Point Channel"
#DDD #Microservices #DistributedSystems
Docs
Journey 6: Versioning Our System
emacsway-log: Software Design, Clean Architecture, DDD, Microservice Architecture, Distributed Systems, XP, Agile, etc.
📝 "Note that just saving the Domain Event in its causal order doesn’t guarantee that it will arrive at other distributed nodes in the same order. Thus, it is also the responsibility of the consuming Bounded Context to recognize proper causality. It might be…
Родственные EIP patterns:
- "Correlation Identifier"
https://www.enterpriseintegrationpatterns.com/patterns/messaging/CorrelationIdentifier.html
- "Message Sequence"
https://www.enterpriseintegrationpatterns.com/patterns/messaging/MessageSequence.html
Применяется в том числе и в Event Sourcing.
В метаданных eventstore есть переменные $causationid and $correlationid.
📝 "The are both really simple patterns I have never quite understood why they end up so misunderstood.
Let's say every message has 3 ids. 1 is its id. Another is correlation the last it causation.
The rules are quite simple. If you are responding to a message, you copy its correlation id as your correlation id, its message id is your causation id.
This allows you to see an entire conversation (correlation id) or to see what causes what (causation id).
Cheers,
Greg Young"
https://discuss.eventstore.com/t/causation-or-correlation-id/828/4
Примеры:
- https://github.com/microsoftarchive/cqrs-journey/blob/6ffd9a8c8e865a9f8209552c52fa793fbd496d1f/noscripts/CreateDatabaseObjects.sql#L57-L62
- https://github.com/kgrzybek/modular-monolith-with-ddd/blob/4e2d66d16f97b3c863fbecd072dad52338516882/src/Modules/Payments/Infrastructure/AggregateStore/SqlStreamAggregateStore.cs#L44-L45
#DDD #Microservices #DistributedSystems #EIP
- "Correlation Identifier"
https://www.enterpriseintegrationpatterns.com/patterns/messaging/CorrelationIdentifier.html
- "Message Sequence"
https://www.enterpriseintegrationpatterns.com/patterns/messaging/MessageSequence.html
Применяется в том числе и в Event Sourcing.
В метаданных eventstore есть переменные $causationid and $correlationid.
📝 "The are both really simple patterns I have never quite understood why they end up so misunderstood.
Let's say every message has 3 ids. 1 is its id. Another is correlation the last it causation.
The rules are quite simple. If you are responding to a message, you copy its correlation id as your correlation id, its message id is your causation id.
This allows you to see an entire conversation (correlation id) or to see what causes what (causation id).
Cheers,
Greg Young"
https://discuss.eventstore.com/t/causation-or-correlation-id/828/4
Примеры:
- https://github.com/microsoftarchive/cqrs-journey/blob/6ffd9a8c8e865a9f8209552c52fa793fbd496d1f/noscripts/CreateDatabaseObjects.sql#L57-L62
- https://github.com/kgrzybek/modular-monolith-with-ddd/blob/4e2d66d16f97b3c863fbecd072dad52338516882/src/Modules/Payments/Infrastructure/AggregateStore/SqlStreamAggregateStore.cs#L44-L45
#DDD #Microservices #DistributedSystems #EIP
Event Store Discuss Forum
causation or correlation id?
Here https://groups.google.com/d/msg/event-store/9dyhwgL2hVA/wFU62XSQtCYJ James Nugent say that when storing commands, events produced by it could have the command id as correlation id. What would a causation id be then? To me it seems that a command causes…
emacsway-log: Software Design, Clean Architecture, DDD, Microservice Architecture, Distributed Systems, XP, Agile, etc.
Одной из непростых тем в DDD и микросервисной архитектуре является т.н. проблема "конкурирующих подписчиков". Это когда два причинно-зависимых события попадают на конкурирующие узлы обработки событий, и второе событие может "обогнать" первое, например, по…
Шпаргалка по EIP-паттернам:
"Enterprise Integration Patterns Tutorial Reference Chart"
https://www.enterpriseintegrationpatterns.com/download/EIPTutorialReferenceChart.pdf
#DDD #Microservices #DistributedSystems #EIP
"Enterprise Integration Patterns Tutorial Reference Chart"
https://www.enterpriseintegrationpatterns.com/download/EIPTutorialReferenceChart.pdf
#DDD #Microservices #DistributedSystems #EIP
emacsway-log: Software Design, Clean Architecture, DDD, Microservice Architecture, Distributed Systems, XP, Agile, etc.
Одной из непростых тем в DDD и микросервисной архитектуре является т.н. проблема "конкурирующих подписчиков". Это когда два причинно-зависимых события попадают на конкурирующие узлы обработки событий, и второе событие может "обогнать" первое, например, по…
Но даже если подписчик всего один, и сообщения доставляются последовательно, то и тогда очередность обработки сообщений может быть нарушена. Пример из NATS-Streaming Server:
📝 "With the redelivery feature, order can’t be guaranteed, since by definition server will resend messages that have not been acknowledged after a period of time. Suppose your consumer receives messages 1, 2 and 3, does not acknowledge 2. Then message 4 is produced, server sends this message to the consumer. The redelivery timer then kicks in and server will resend message 2. The consumer would see messages: 1, 2, 3, 4, 2, 5, etc...
In conclusion, the server does not offer this guarantee although it tries to redeliver messages first thing on startup. That being said, if the durable is stalled (number of outstanding messages >= MaxInflight), then the redelivery will also be stalled, and new messages will be allowed to be sent. When the consumer resumes acking messages, then it may receive redelivered and new messages interleaved (new messages will be in order though)."
- nats-streaming-server, issue #187 "Order of delivery", comment by Ivan Kozlovic
https://github.com/nats-io/nats-streaming-server/issues/187#issuecomment-257024506
#DDD #Microservices #DistributedSystems
📝 "With the redelivery feature, order can’t be guaranteed, since by definition server will resend messages that have not been acknowledged after a period of time. Suppose your consumer receives messages 1, 2 and 3, does not acknowledge 2. Then message 4 is produced, server sends this message to the consumer. The redelivery timer then kicks in and server will resend message 2. The consumer would see messages: 1, 2, 3, 4, 2, 5, etc...
In conclusion, the server does not offer this guarantee although it tries to redeliver messages first thing on startup. That being said, if the durable is stalled (number of outstanding messages >= MaxInflight), then the redelivery will also be stalled, and new messages will be allowed to be sent. When the consumer resumes acking messages, then it may receive redelivered and new messages interleaved (new messages will be in order though)."
- nats-streaming-server, issue #187 "Order of delivery", comment by Ivan Kozlovic
https://github.com/nats-io/nats-streaming-server/issues/187#issuecomment-257024506
#DDD #Microservices #DistributedSystems
GitHub
Order of delivery · Issue #187 · nats-io/nats-streaming-server
Does nats-streaming-server make any guarantees about the order of messages delivered to a subscriber? E.g. at a base level, if a single publisher writes messages A, B, C to the same topic, will a s...
emacsway-log: Software Design, Clean Architecture, DDD, Microservice Architecture, Distributed Systems, XP, Agile, etc.
Одной из непростых тем в DDD и микросервисной архитектуре является т.н. проблема "конкурирующих подписчиков". Это когда два причинно-зависимых события попадают на конкурирующие узлы обработки событий, и второе событие может "обогнать" первое, например, по…
Кстати, проблема очередности доставки сообщений хорошо описана в главе "Projections and Queries :: Building read models from events :: Subnoscriptions" книги "Hands-On Domain-Driven Design with .NET Core: Tackling complexity in the heart of software by putting DDD principles into practice" by Alexey Zimarev ( @zimareff )
https://www.amazon.com/Hands-Domain-Driven-Design-NET-ebook/dp/B07C5WSR9B
И он добавил несколько интересных аргументов в чат канала:
https://news.1rj.ru/str/emacsway_chat/85
P.S.: это один из тех людей, кому я искренне благодарен за влияние на мое профессиональное развитие.
#DDD #Microservices #DistributedSystems
https://www.amazon.com/Hands-Domain-Driven-Design-NET-ebook/dp/B07C5WSR9B
И он добавил несколько интересных аргументов в чат канала:
https://news.1rj.ru/str/emacsway_chat/85
P.S.: это один из тех людей, кому я искренне благодарен за влияние на мое профессиональное развитие.
#DDD #Microservices #DistributedSystems
Telegram
Alexey Zimarev in emacsway-chat
Ну, я имею ввиду вообще :) Actor model во многих ситуациях может быть полезным паттерном.
Немного юмора в тему "Совершенного Кода":
https://github.com/kelseyhightower/nocode
#SoftwareDesign #CleanArchitecture
https://github.com/kelseyhightower/nocode
#SoftwareDesign #CleanArchitecture
GitHub
GitHub - kelseyhightower/nocode: The best way to write secure and reliable applications. Write nothing; deploy nowhere.
The best way to write secure and reliable applications. Write nothing; deploy nowhere. - kelseyhightower/nocode
Кстати, Яндекс-Переводчик знает толк в "Совершенстве" 🙂
Уже старая, но невероятно полезная статья для тех, кто впервые работает на заказчика из США:
https://bulochnikov.livejournal.com/2326301.html
#Career
https://bulochnikov.livejournal.com/2326301.html
#Career
Livejournal
Разница менталитетов и национальных деловых культур.
1-- Запад есть Запад, Восток есть Восток. О разнице культур и взаимодействии внутри международной компании Разница менталитетов и национальных деловых культур тема вечная и актуальности своей не теряющая: чужая душа по-прежнему потемки, а чужая заокеанная…
Если вдруг кто пропустил эту новость - вышло второе издание бестселлера "The Pragmatic Programmer: your journey to mastery, 20th Anniversary Edition" (2nd Edition) by David Thomas: https://www.amazon.com/Pragmatic-Programmer-journey-mastery-Anniversary/dp/0135957052/
Автор - один из 17 подписантов Agile-manifesto и его соавтор.
Кстати, Dave тоже ударился в функциональное программирование, и написал книгу "Programming Elixir".
А так же он был редактором книги Джо Армстронга по Эрлангу:
"Dave Thomas edited my Erlang book"
https://web.archive.org/web/20170830231254/http://joearms.github.io/2013/05/31/a-week-with-elixir.html
#Agile #Career #FunctionalProgramming
Автор - один из 17 подписантов Agile-manifesto и его соавтор.
Кстати, Dave тоже ударился в функциональное программирование, и написал книгу "Programming Elixir".
А так же он был редактором книги Джо Армстронга по Эрлангу:
"Dave Thomas edited my Erlang book"
https://web.archive.org/web/20170830231254/http://joearms.github.io/2013/05/31/a-week-with-elixir.html
#Agile #Career #FunctionalProgramming
📝 "A good architecture is characterized by crisp abstractions, a good separation of concerns, a clear distribution of responsibilities, and simplicity.
All else is details."
- Grady Booch. Позавчера.
https://twitter.com/Grady_Booch/status/1301810362119905285?s=19
[UPDATED]: Там весь тред заслуживает на прочтение.
#SoftwareDesign #SoftwareArchitecture
All else is details."
- Grady Booch. Позавчера.
https://twitter.com/Grady_Booch/status/1301810362119905285?s=19
[UPDATED]: Там весь тред заслуживает на прочтение.
#SoftwareDesign #SoftwareArchitecture
X (formerly Twitter)
Grady Booch (@Grady_Booch) on X
A good architecture is characterized by crisp abstractions, a good separation of concerns, a clear distribution of responsibilities, and simplicity.
All else is details.
All else is details.
emacsway-log: Software Design, Clean Architecture, DDD, Microservice Architecture, Distributed Systems, XP, Agile, etc.
📝 "A good architecture is characterized by crisp abstractions, a good separation of concerns, a clear distribution of responsibilities, and simplicity. All else is details." - Grady Booch. Позавчера. https://twitter.com/Grady_Booch/status/1301810362119905285?s=19…
В том же треде:
📝 "All architecture is design, but not all design is architecture.
Architecture represents the set of significant design decisions that shape the form and the function of a system, where significant is measured by cost of change."
- Grady Booch
https://twitter.com/Grady_Booch/status/1301810380675588096?s=19
#SoftwareDesign #SoftwareArchitecture
📝 "All architecture is design, but not all design is architecture.
Architecture represents the set of significant design decisions that shape the form and the function of a system, where significant is measured by cost of change."
- Grady Booch
https://twitter.com/Grady_Booch/status/1301810380675588096?s=19
#SoftwareDesign #SoftwareArchitecture
X (formerly Twitter)
Grady Booch (@Grady_Booch) on X
All architecture is design, but not all design is architecture.
Architecture represents the set of significant design decisions that shape the form and the function of a system, where significant is measured by cost of change.
Architecture represents the set of significant design decisions that shape the form and the function of a system, where significant is measured by cost of change.
emacsway-log: Software Design, Clean Architecture, DDD, Microservice Architecture, Distributed Systems, XP, Agile, etc.
📝 "A good architecture is characterized by crisp abstractions, a good separation of concerns, a clear distribution of responsibilities, and simplicity. All else is details." - Grady Booch. Позавчера. https://twitter.com/Grady_Booch/status/1301810362119905285?s=19…
Там же:
📝 "You cannot reduce the complexity of a software-intensive systems; the best you can do is manage it."
- Grady Booch
https://twitter.com/Grady_Booch/status/1301810363734736896?s=19
#SoftwareDesign #SoftwareArchitecture
📝 "You cannot reduce the complexity of a software-intensive systems; the best you can do is manage it."
- Grady Booch
https://twitter.com/Grady_Booch/status/1301810363734736896?s=19
#SoftwareDesign #SoftwareArchitecture
Twitter
Grady Booch
You cannot reduce the complexity of a software-intensive systems; the best you can do is manage it.
emacsway-log: Software Design, Clean Architecture, DDD, Microservice Architecture, Distributed Systems, XP, Agile, etc.
📝 "A good architecture is characterized by crisp abstractions, a good separation of concerns, a clear distribution of responsibilities, and simplicity. All else is details." - Grady Booch. Позавчера. https://twitter.com/Grady_Booch/status/1301810362119905285?s=19…
Гы... недавно был холиварчик в архитекторской группе на эту тему. Там же:
📝 "A software architect who does not code is like a cook who does not eat."
- Grady Booch
https://twitter.com/Grady_Booch/status/1301810374598033408?s=19
#SoftwareDesign #SftwareArchitecture
📝 "A software architect who does not code is like a cook who does not eat."
- Grady Booch
https://twitter.com/Grady_Booch/status/1301810374598033408?s=19
#SoftwareDesign #SftwareArchitecture
Twitter
Grady Booch
A software architect who does not code is like a cook who does not eat.
📝 "An honest estimate is not a date. It is always a range of dates with probabilities assigned to the range."
- Robert C. Martin
https://twitter.com/unclebobmartin/status/1302600840138485760?s=19
#Agile
- Robert C. Martin
https://twitter.com/unclebobmartin/status/1302600840138485760?s=19
#Agile
Twitter
Uncle Bob Martin
An honest estimate is not a date. It is always a range of dates with probabilities assigned to the range.
Знаете этого парня, да?
- https://leanpub.com/u/johnbywater
А его книгу?
- https://leanpub.com/dddwithpython
#DDD #DistributedSystems #EIP #EDA #Microservices
- https://leanpub.com/u/johnbywater
А его книгу?
- https://leanpub.com/dddwithpython
#DDD #DistributedSystems #EIP #EDA #Microservices
Leanpub
Event Sourcing in Python
A pattern language for event sourced applications and reliable distributed systems. Examples are written in the Python programming language. Now includes event-oriented introductions to the pattern language scheme of Christopher Alexander, the process philosophy…
Две превосходные статьи о том, как устроено сжатие данных в time-series расширении TimescaleDB для PostreSQL.
- https://blog.timescale.com/blog/time-series-compression-algorithms-explained/
- https://blog.timescale.com/blog/building-columnar-compression-in-a-row-oriented-database/
#Database #PosgreSQL #HighLoad #Scaling
- https://blog.timescale.com/blog/time-series-compression-algorithms-explained/
- https://blog.timescale.com/blog/building-columnar-compression-in-a-row-oriented-database/
#Database #PosgreSQL #HighLoad #Scaling
Timescale Blog
Time-series compression algorithms, explained
Delta-delta encoding, Simple-8b, XOR-based compression, and more - these algorithms aren't magic, but combined they can save over 90% of storage costs and speed up queries. Here’s how they work.
Forwarded from Никита Соболев
Awesome video to switch off your brain before going to sleep on a sunday night: https://www.youtube.com/watch?v=hzf3hTUKk8U 😴
YouTube
Functional Programming is Terrible
Rúnar Bjarnason loves functional programming, but here he plays devil's advocate and addresses some of its shortcomings. (Don't worry, there's a happy ending).
** Scala training from NewCircle: https://newcircle.com/category/scala
http://nescala.org/
** Scala training from NewCircle: https://newcircle.com/category/scala
http://nescala.org/
Немного дискуссионный, но весьма интересный материал от Vladimir Khorikov ( @vkhorikov ) на один из самых частых вопросов в DDD - может ли один агрегат иметь ассоциацию по ссылке с другим агрегатом?
"Link to an aggregate: reference or Id?"
https://enterprisecraftsmanship.com/posts/link-to-an-aggregate-reference-or-id/
#DDD #Microservices
"Link to an aggregate: reference or Id?"
https://enterprisecraftsmanship.com/posts/link-to-an-aggregate-reference-or-id/
#DDD #Microservices
Enterprise Craftsmanship
Link to an aggregate: reference or Id?
In this post, I write about 2 ways of representing a link to an aggregate.
Знатный холиварчик титанов получился на тему FP vs OOP. Не без интересных исторических подробностей.
https://twitter.com/Grady_Booch/status/1302678071049216000?s=19
#FunctionalProgramming #OOP
https://twitter.com/Grady_Booch/status/1302678071049216000?s=19
#FunctionalProgramming #OOP
Twitter
Grady Booch
I, for one, love OOP. (And really??? The author thinks a minor Byte article was the source of how many were introduced to the concept? What historical crap.) stackoverflow.blog/2020/09/02/if-…