Save 37% off PRO during our Black Friday Sale! »

おやじのLambda

 おやじのLambda

Event Sourcing and CQRS with AWS Lambda, DynamoDB, SNS
Serverless
Microservices
Clean Architecture

D0aa730283951b33a1f61389ba0a87b7?s=128

Takashi Yagita

February 20, 2019
Tweet

Transcript

  1. None
  2. ͓΍͡ͷಛੑ  )  (    

  3. ͓΍͡ͷੜ͖ํ  

  4. None
  5. ΍ͬͯΈΔ

  6. ޱ࠲ "DDPVOU ࣝผ൪߸ ঢ়ଶ ཤྺ

  7. ۜߦޱ࠲ ޱ࠲൪߸ ࢒ߴ ঢ়ଶ ཤྺ ೖۚɾग़ۚ ঎඼ࡏݿ ঎඼൪߸ ࡏݿ ཤྺ

    ೖݿɾग़ݿ 
  8. ঎඼ࡏݿ ঎඼൪߸ ࡏݿ ཤྺ ೖݿɾग़ݿ ( ) ) ) C

    ) C D ) C BE Q S )C )
  9. https://www.slideshare.net/AmazonWebServices/messaging-in-the-aws-cloud https://www.slideshare.net/AntonUdovychenko/going-serverless-with-cqrs-on-aws

  10. None
  11. None
  12. None
  13. None
  14. None
  15. Stock Entity State { 'available’: 17,'reserved’: 3, 'bought’: 2 }

    Stock Methods Calculate(orders, initial_stock) ɾɾɾ Attributes id name state [Orders] Events
  16.  $PNNBOE &WFOU &WFOU 4UPSF 4UBUF %ZOBNP%#4USFBNT 'PMEJOH /INSERT Amazon

    API Gateway Amazon API Gateway 'PMEJOH %FGFSFODF 2VFSZ INSERTͷΈ Query INSERT/REMOVE AT LEAST ONCE Snapshot #BDLVQ /REMOVE Other Service Message .FTTBHF#VT &WFOU 4UPSF
  17.  $PNNBOE &WFOU &WFOU 4UPSF 4UBUF 'PMEJOH /INSERT Amazon API

    Gateway Amazon API Gateway 'PMEJOH %FGFSFODF 2VFSZ INSERTͷΈ Query INSERT/REMOVE AT LEAST ONCE Snapshot ঎඼ࡏݿ ঎඼൪߸ ࡏݿ ཤྺ ೖݿɾग़ݿ
  18. Folding (reduce) Snapshots { 'available’: 17, 'reserved’: 0, 'bought’: 3

    } 5 111 4 { 'available’: 15, 'reserved’: 2, 'bought’: 3 } 111 3 { 'available’: 15, 'reserved’: 5, 'bought’: 0 } 111 { 'available’: 17, 'reserved’: 3, 'bought’: 0 } 2 111 1 version state item id 111 { 'available’: 20, 'reserved’: 0, 'bought’: 0 }
  19. $PNNBOE &WFOU &WFOU 4UPSF 4UBUF %ZOBNP%#4USFBNT 'PMEJOH /INSERT Amazon API

    Gateway Amazon API Gateway 'PMEJOH %FGFSFODF 2VFSZ INSERTͷΈ Query INSERT/REMOVE AT LEAST ONCE Snapshot #BDLVQ /REMOVE Other Service Message .FTTBHF#VT &WFOU 4UPSF Overview (3 ) E ) g S Fd M )3 D M D e U E a ) ) M ) D B )
  20. Clean Architecture & B

  21. Controller dict Entity Repository DataStore ResponseObject UseCase RequestObject request_object request_object

    response_object response_object dict dict entity entity entity entity entity dict entity Amazon DynamoDB
  22. device_contrller lambda_handler DeviceRegisterUseCase OipMfpDevice DeviceRepository DeviceDataStore DynamoDB () ) )

    Stock Methods Calculate(orders, initial_stock) ɾɾɾ Attributes id name state [Orders]
  23. None