aws, play! couch db scaling soa in the cloud
TRANSCRIPT
![Page 1: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/1.jpg)
AWS, Play! CouchDB: Scaling SOA in the cloud
Christophe Marchal | Software Architect
![Page 2: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/2.jpg)
@toff63
http://github.com/toff63
http://francesbagual.net
About me
![Page 3: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/3.jpg)
www.ilegra.com
![Page 4: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/4.jpg)
Project
● MVP for
● 6 months
● Brazilian taxation
● 5 Developers + 1 Product Owner
![Page 5: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/5.jpg)
Requirements
● Cadastre
● NFe validation
● Taxation violation reports
● Fix prices simulator
● Quotation price simulator
![Page 6: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/6.jpg)
Non Functional goals
SOA
![Page 7: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/7.jpg)
SOA para um prototipo?!
![Page 8: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/8.jpg)
When I say SOA people think: Framework
![Page 9: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/9.jpg)
When I say SOA people think: Framework
![Page 10: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/10.jpg)
When I say SOA people think: Highly Complex System
![Page 11: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/11.jpg)
When I say SOA people think 5 year project
![Page 12: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/12.jpg)
However, SOA is about Principles
![Page 13: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/13.jpg)
SOA
![Page 14: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/14.jpg)
SOA is about decoupling
![Page 15: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/15.jpg)
SOA is about SOC
![Page 16: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/16.jpg)
SOA is about Flexibility
![Page 17: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/17.jpg)
Strategic goal: get the MVP ready on time
➔ Minimum viable architecture➔ Minimum viable design➔ Only create tests that are relevant➔ Remove any waste
![Page 18: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/18.jpg)
Evolutionary refinement
![Page 19: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/19.jpg)
Definition of services
Define the first services:● NFe● Report● Company● User
![Page 20: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/20.jpg)
Choosing Play!
HTTP server
Lightweight
Stateless
Easy to learn
Functional
Easy to create
API
AsynC IO
REACTIVE
![Page 21: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/21.jpg)
Play SubProject
![Page 22: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/22.jpg)
Play HTTP client
![Page 23: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/23.jpg)
Play HTTP client: Internal Calls
![Page 24: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/24.jpg)
Service design
Contract
Presentation
Service Layer
Persistence Gateway
Contract / Trait
HTTP + HTML
● Simple design
● SOC
● Trait yet in place for future separation
● Lightweight
![Page 25: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/25.jpg)
Monolithic deploy: pre containers solution
NFe
user Reportcompany
● 1 debian package
● Each module independant
● No current need to have deploy isolation
● No current need to separate by service
profile
![Page 26: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/26.jpg)
AWS Deploy
![Page 27: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/27.jpg)
1 conf to rule them all with AWS private DNS
Application config:● couchdb.internal● redis.internal
DNS configuration change in every environment
![Page 28: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/28.jpg)
What kind of NoSQL ?
● NFe is a document
● Huge amount of NFe to store
![Page 29: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/29.jpg)
Why CouchDB?
● HTTP Interface
● Incremental map/reduce
● Polyglot Persistence ready
● Easy and simple to use
![Page 30: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/30.jpg)
CouchDB: DB and Documents
http://mycouchdbserver:5984/pessoas http://mycouchdbserver:5984/pessoas/1
![Page 31: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/31.jpg)
CouchDB: Design documents
http://mycouchdbserver:5984/pessoas/_design/list_v1
![Page 32: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/32.jpg)
SOA with CouchDB
● Version your document
● Version you Design Document
● You can get backward compatibility in your database
● Ease database index migrations
● Let you do Canary Deploys
● Let you do Continuous Deployment with no downtime
HOW
BENEfits
![Page 33: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/33.jpg)
AWS Deploy
![Page 34: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/34.jpg)
ElasticSearch for filtering
![Page 35: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/35.jpg)
ElasticSearch for filtering
![Page 36: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/36.jpg)
Almost no db is shared between services
NFE Service Report Service
NFe
![Page 37: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/37.jpg)
But a scalable solution would be ...
![Page 38: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/38.jpg)
Summary
● SOA isn’t about project size
● SOA can be applied to any project
● Don’t rush to complexity
● Create proper abstractions to handle potentials future problems
● Version everything in your system
● Take advantage of the cloud
![Page 39: Aws, play! couch db scaling soa in the cloud](https://reader034.vdocument.in/reader034/viewer/2022052401/55b943aabb61eb576f8b4598/html5/thumbnails/39.jpg)
Christophe Marchal | Software Architect
Thanks for your Attention! Any question?