Top Banner
AWS, Play! CouchDB: Scaling SOA in the cloud Christophe Marchal | Software Architect
39

Aws, play! couch db scaling soa in the cloud

Jul 30, 2015

Download

Technology

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Aws, play! couch db  scaling soa in the cloud

AWS, Play! CouchDB: Scaling SOA in the cloud

Christophe Marchal | Software Architect

Page 3: Aws, play! couch db  scaling soa in the cloud

www.ilegra.com

Page 4: Aws, play! couch db  scaling soa in the cloud

Project

● MVP for

● 6 months

● Brazilian taxation

● 5 Developers + 1 Product Owner

Page 5: Aws, play! couch db  scaling soa in the cloud

Requirements

● Cadastre

● NFe validation

● Taxation violation reports

● Fix prices simulator

● Quotation price simulator

Page 6: Aws, play! couch db  scaling soa in the cloud

Non Functional goals

SOA

Page 7: Aws, play! couch db  scaling soa in the cloud

SOA para um prototipo?!

Page 8: Aws, play! couch db  scaling soa in the cloud

When I say SOA people think: Framework

Page 9: Aws, play! couch db  scaling soa in the cloud

When I say SOA people think: Framework

Page 10: Aws, play! couch db  scaling soa in the cloud

When I say SOA people think: Highly Complex System

Page 11: Aws, play! couch db  scaling soa in the cloud

When I say SOA people think 5 year project

Page 12: Aws, play! couch db  scaling soa in the cloud

However, SOA is about Principles

Page 13: Aws, play! couch db  scaling soa in the cloud

SOA

Page 14: Aws, play! couch db  scaling soa in the cloud

SOA is about decoupling

Page 15: Aws, play! couch db  scaling soa in the cloud

SOA is about SOC

Page 16: Aws, play! couch db  scaling soa in the cloud

SOA is about Flexibility

Page 17: Aws, play! couch db  scaling soa in the cloud

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

Evolutionary refinement

Page 19: Aws, play! couch db  scaling soa in the cloud

Definition of services

Define the first services:● NFe● Report● Company● User

Page 20: Aws, play! couch db  scaling soa in the cloud

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

Play SubProject

Page 22: Aws, play! couch db  scaling soa in the cloud

Play HTTP client

Page 23: Aws, play! couch db  scaling soa in the cloud

Play HTTP client: Internal Calls

Page 24: Aws, play! couch db  scaling soa in the cloud

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

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

AWS Deploy

Page 27: Aws, play! couch db  scaling soa in the cloud

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

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

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

CouchDB: DB and Documents

http://mycouchdbserver:5984/pessoas http://mycouchdbserver:5984/pessoas/1

Page 31: Aws, play! couch db  scaling soa in the cloud

CouchDB: Design documents

http://mycouchdbserver:5984/pessoas/_design/list_v1

Page 32: Aws, play! couch db  scaling soa in the cloud

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

AWS Deploy

Page 34: Aws, play! couch db  scaling soa in the cloud

ElasticSearch for filtering

Page 35: Aws, play! couch db  scaling soa in the cloud

ElasticSearch for filtering

Page 36: Aws, play! couch db  scaling soa in the cloud

Almost no db is shared between services

NFE Service Report Service

NFe

Page 37: Aws, play! couch db  scaling soa in the cloud

But a scalable solution would be ...

Page 38: Aws, play! couch db  scaling soa in the cloud

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

Christophe Marchal | Software Architect

Thanks for your Attention! Any question?