AWS, Play! CouchDB: Scaling SOA in the cloud
Christophe Marchal | Software Architect
@toff63
http://github.com/toff63
http://francesbagual.net
About me
www.ilegra.com
Project
● MVP for
● 6 months
● Brazilian taxation
● 5 Developers + 1 Product Owner
Requirements
● Cadastre
● NFe validation
● Taxation violation reports
● Fix prices simulator
● Quotation price simulator
Non Functional goals
SOA
SOA para um prototipo?!
When I say SOA people think: Framework
When I say SOA people think: Framework
When I say SOA people think: Highly Complex System
When I say SOA people think 5 year project
However, SOA is about Principles
SOA
SOA is about decoupling
SOA is about SOC
SOA is about Flexibility
Strategic goal: get the MVP ready on time
➔ Minimum viable architecture➔ Minimum viable design➔ Only create tests that are relevant➔ Remove any waste
Evolutionary refinement
Definition of services
Define the first services:● NFe● Report● Company● User
Choosing Play!
HTTP server
Lightweight
Stateless
Easy to learn
Functional
Easy to create
API
AsynC IO
REACTIVE
Play SubProject
Play HTTP client
Play HTTP client: Internal Calls
Service design
Contract
Presentation
Service Layer
Persistence Gateway
Contract / Trait
HTTP + HTML
● Simple design
● SOC
● Trait yet in place for future separation
● Lightweight
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
AWS Deploy
1 conf to rule them all with AWS private DNS
Application config:● couchdb.internal● redis.internal
DNS configuration change in every environment
What kind of NoSQL ?
● NFe is a document
● Huge amount of NFe to store
Why CouchDB?
● HTTP Interface
● Incremental map/reduce
● Polyglot Persistence ready
● Easy and simple to use
CouchDB: DB and Documents
http://mycouchdbserver:5984/pessoas http://mycouchdbserver:5984/pessoas/1
CouchDB: Design documents
http://mycouchdbserver:5984/pessoas/_design/list_v1
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
AWS Deploy
ElasticSearch for filtering
ElasticSearch for filtering
Almost no db is shared between services
NFE Service Report Service
NFe
But a scalable solution would be ...
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
Christophe Marchal | Software Architect
Thanks for your Attention! Any question?
Top Related