in microservices using ddd, event sourcing & cqrscare payments insights integration 2. kotlin...
TRANSCRIPT
![Page 1: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/1.jpg)
in Microservices using DDD, Event Sourcing & CQRS
Augusto BranquinhoMike Shigueru Matsumoto
![Page 2: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/2.jpg)
Technical stack
1. Real Wave
Modules
Information
Frontend
Integration
Backend
Marketing
Sales
Care
Payments
Insights
Integration
![Page 3: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/3.jpg)
2. Kotlin
Designed by Jetbrains
Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera, etc
Statically typed
Modern
Drastically reduce the boilerplate
Java, Android
Javascript
Native
![Page 4: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/4.jpg)
2. Kotlin
Data Class
toString
equals
hashCode
copy
properties - get/set
![Page 5: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/5.jpg)
2. Kotlin
🤢 Java
😎 Kotlin
Lambda
![Page 6: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/6.jpg)
2. Kotlin
Higher Order Functions
![Page 7: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/7.jpg)
2. Kotlin
Extension method
Reified & Inline
![Page 8: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/8.jpg)
2. Kotlin
Smart cast
Pattern matching
String template
Reified
Operator overloading
Unit and Nothing
High order function
Infix
Internal
Properties
Extension methods/properties
Lazy initialization, Delegation
Object (singleton)
Deprecated
Default value
Tacit programming: let, also, apply, run, with
Tailrec
…
![Page 9: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/9.jpg)
3. Event Sourcing & CQRS
Event Sourcing (ES)
100% reliable logging (aka: version control)
all operations on the system are stream event-oriented: nothing happens before the event being committed
it is possible to rebuild all the views since the beginning of time
you can build new views using the same principle
events are immutable
![Page 10: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/10.jpg)
3. Event Sourcing & CQRS
CQRS
"It's a pattern" (Greg Young)
uses a different model to update (Command) and another to read (Query)
Command (accept/reject)Change stateEvents
Query (views)Are free of side effects
![Page 11: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/11.jpg)
3. Event Sourcing & CQRS
MotivationES, CQRS
Clients: Bank, TelecomAudit Log (query the past)InsightsMultiple views (Multi-Tenant)
E.g.: Catalog managerReliable logsOffers are immutableHigh requests rate (millions)Decoupled views
![Page 12: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/12.jpg)
3. Event Sourcing & CQRS
Real Wave Microservices
Command Api
Catalog Manager
Query Api
Catalog Search
Join Use Pay
query response
Catalog Processor
accept/reject
Offers
![Page 13: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/13.jpg)
3. Event Sourcing & CQRS
Catalog Search
Catalog Processor
Low write latency
High read latency
Catalog Manager
![Page 14: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/14.jpg)
3. Event Sourcing & CQRS
Code
![Page 15: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/15.jpg)
3. Event Sourcing & CQRS
![Page 16: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/16.jpg)
Command Bus
3. Event Sourcing & CQRS
DDD
![Page 17: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/17.jpg)
Command Bus
3. Event Sourcing & CQRS
❌✔Bounded Context
![Page 18: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/18.jpg)
3. Event Sourcing & CQRS
Command Bus
First Command
Nothing was replayed yet
![Page 19: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/19.jpg)
3. Event Sourcing & CQRS
DDD
![Page 20: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/20.jpg)
3. Event Sourcing & CQRS
![Page 21: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/21.jpg)
3. Event Sourcing & CQRS
Happens in the past
Just accept, no logic here
![Page 22: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/22.jpg)
3. Event Sourcing & CQRS
Command Bus ❌❌Not here yet!!!
![Page 23: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/23.jpg)
3. Event Sourcing & CQRS
Command Bus
Replay for all past events will start for this ID before this Command executes⚠
![Page 24: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/24.jpg)
3. Event Sourcing & CQRS
1 - Replay
![Page 25: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/25.jpg)
3. Event Sourcing & CQRS
2 - Accepts/Rejects
1 - Replay
![Page 26: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/26.jpg)
3. Event Sourcing & CQRS
3 - Accepted
1 - Replay
2 - Accepts/Rejects
![Page 27: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/27.jpg)
3. Event Sourcing & CQRS
Catalog Processor
Another team maybe?🤔
![Page 28: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/28.jpg)
3. Event Sourcing & CQRS
![Page 29: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/29.jpg)
3. Event Sourcing & CQRS
![Page 30: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/30.jpg)
3. Event Sourcing & CQRS
![Page 31: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/31.jpg)
3. Event Sourcing & CQRS
Catalog Search
![Page 32: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/32.jpg)
Micro Services
3. Event Sourcing & CQRS
A
B
CD
E
F Catalog Search
Catalog 1Catalog 2
Catalog 3Catalog n
![Page 33: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/33.jpg)
3. Event Sourcing & CQRS
😌Conclusion
![Page 34: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/34.jpg)
3. Event Sourcing & CQRS
🔥Burn down
Conclusion😌
![Page 35: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/35.jpg)
3. Event Sourcing & CQRS
🏗Replay
TODOsnapshotssagas
recoveryfix inconsistencybuild a new view
😌Conclusion
![Page 36: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/36.jpg)
Motivation
KotlinEvents (immutable) (Axon)
Catalog v1Data class (boilerplate)Event Stream
lambdaModernEasy to learn…
4. Kotlin, DDD, ES & CQRS
![Page 37: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/37.jpg)
Why should you try using Kotlin?
4. Kotlin, DDD, ES & CQRS
![Page 38: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/38.jpg)
4. Kotlin, DDD, ES & CQRS
Events (Event Store Database)Smart Casts
Pattern Matching
Final
Sealed Class
![Page 39: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/39.jpg)
4. Kotlin, DDD, ES & CQRS
Events (Event Store Database)
![Page 40: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/40.jpg)
4. Kotlin, DDD, ES & CQRS
Events (Event Store Database)
![Page 41: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/41.jpg)
4. Kotlin, DDD, ES & CQRS
Value Objects - data classTypesafe
Primitive ObsessionInvalid ObjectsImmutability
![Page 42: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/42.jpg)
4. Kotlin, DDD, ES & CQRS
Anemic Domain Model - kotlin extensionsOnly Getters / SettersServices Layers are OVER ABUSED!!!
😎
😖
![Page 43: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/43.jpg)
5. Kotlin 102
Tests
![Page 44: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/44.jpg)
5. Kotlin 102
Coroutines
asynchronous programming
we put the complications into libraries
experimental != unsecurity
![Page 45: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/45.jpg)
5. Kotlin 102
Coroutines
What's the result?
![Page 46: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/46.jpg)
5. Kotlin 102
Coroutines
What's the result?
![Page 47: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/47.jpg)
5. Kotlin 102
Coroutines are light weight! 😱
![Page 48: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/48.jpg)
5. Kotlin 102
Coroutines are light weight!
😱
😱
![Page 49: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/49.jpg)
Coroutines - async/await
5. Kotlin 102
![Page 50: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/50.jpg)
5. Kotlin 102
Kotlin is the path to Functional Programming. Functional Programming leads to Pure Functions, Pure Functions leads to Monad and Asynchronous Programming. Asynchronous Programming leads to Reactive Programming.
Master Yoda - Return of the Jedi
![Page 51: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/51.jpg)
5. Kotlin 102
Functional ProgrammingPurity (no-side effect) Purity vs I/O
Exceptions propagationThread limits
Referential Transparency
![Page 52: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/52.jpg)
5. Kotlin 102Monad/Either - zkotlinhttps://github.com/ZupIT/zkotlin
![Page 53: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/53.jpg)
5. Kotlin 102Monad - Either -> Either -> Either
FOLD HELL
![Page 54: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/54.jpg)
5. Kotlin 102
Either foldCompose
![Page 55: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/55.jpg)
5. Kotlin 102
Either foldCompose ping-pong effectE.g. Payments Retry
😞
![Page 56: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/56.jpg)
5. Kotlin 102
Either foldCompose ping-pong effect
😇
![Page 57: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/57.jpg)
5. Kotlin 102
Either foldCompose ping-pong effect
😎
![Page 58: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/58.jpg)
5. Kotlin 102
Either, Coroutines, Extensions, zkotlin all together
![Page 59: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/59.jpg)
5. Kotlin 102
Wraps I/O problems with Either<L,R>
![Page 60: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/60.jpg)
5. Kotlin 102
Wraps I/O problems with Either<L,R>
✔
❌
❌
Remote I/O
![Page 61: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/61.jpg)
5. Kotlin 102
sync {}
async {}
![Page 62: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/62.jpg)
5. Kotlin 102runBlocking
![Page 63: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/63.jpg)
5. Kotlin 102zkotlin
Couroutines/Ext. Methods
![Page 64: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/64.jpg)
5. Kotlin 102Conclusion
Kotlin & Functional ProgrammingPurity, Referential Transparency, Immutability
Higher-order functionsSugar syntax (it, ƛ as last parameter)
Less boilerplatea nicer syntax to compose Either pattern
Coroutines is easy to use
Ready for Spring Reactor
Catalog Reindex Process before Coroutines: +/- 30 m, after < 4 m
😌
![Page 65: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/65.jpg)
Everything is final on Kotlin
6. Kotlin, Java & Legacy
Spock Mockito
![Page 66: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/66.jpg)
SpringBoot - allopen
6. Kotlin, Java & Legacy
final
![Page 67: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/67.jpg)
6. Kotlin, Java & Legacy
JPA
![Page 68: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/68.jpg)
6. Kotlin, Java & Legacy
Spring Data QueryDSL - Plugins (modules)
Default Interface Java 8 (Kotlin 1.2.40)
Lambdas return - Unit
![Page 69: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/69.jpg)
Mike Shigueru MatsumotoEmail: [email protected]
Augusto BranquinhoEmail: [email protected]
Conclusion
![Page 70: in Microservices using DDD, Event Sourcing & CQRSCare Payments Insights Integration 2. Kotlin Designed by Jetbrains Kotlin in production: Google, Pivotal, Uber, Atlassian, Coursera,](https://reader035.vdocuments.mx/reader035/viewer/2022062414/5ed2e68a6d79440c0a443a93/html5/thumbnails/70.jpg)
540+ Zuppers.Uberlândia MGUI / UX / R&D / DEV / SUPPORT
São José do Rio Preto SPDEV
Ribeirão Preto SPUI/UX/DESIGN
São Paulo SPSALES / CONSULTING / PMO / REQUIREMENTSUI/UXJoinville SC
R&D
Lisboa, PortugalSALES / CONSULTING / R&D
BH MGUI / UX / R&D / DEV
We’re a fast growing company (2011), but just starting.Kevin EfrusyAccel Ventures
Romero RodriguesBuscapé Company
Martin ScobariGeneral Atlantic
Silvio GenesiniSilvigen Consultoria
Zup