building simple node.js microservices using hapi and · pdf filebuilding simple node.js...

Post on 24-Mar-2018

252 Views

Category:

Documents

4 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Building simple Node.jsMicroservices using Hapi and

RedisJeff Barczewski

codewinds.com

CodeWindsTraining

Building simple Node.jsMicroservices using Hapi and

Redis

slides, code, resources, notes@jeffbski and @codewindsjeff@codewinds.com

codewinds.com/nc2015

Who is Jeff Barczewski?CodeWinds Online Training26 yrs Software EngineerUSAF, RGA, Elsevier, MasterCard@jeffbski jeff@codewinds.com

Story of a monolithLarge highly coupled codebaseStuck on old technologyMinimal testsLimited documentationSiloed knowledge

Story of a monolith - p2Slow feature cycle timeCustom forks for clientsHard to scaleDefects and regressions

Learning from HistoryDo One Thing and Do It Well - Unix

Piping data between programsSOA w/ESB, Soap - complexityREST - simplicity

Credits: by - Avatar Surfing On Soap Bar schoschie CC BY-SA 2.0

Requirements ChangeReal-time web/apps - pushWeb for transactions, RPC style

large number of small resourcesdynamic tuning of data by deviceFalcorJS w/JSON GraphRelay w/GraphQL

MicroservicesAka: fine grained SOA, Replaceable ComponentArchitectureTerm emerged for this style architecture 2011-2012Many opinions

Microservices (MSA)Architectural style that generallyutilizes small focused processescommunicating over lightweight

means

Microservice BenefitsIndependently deployable, replaceable,upgradeableElastic and scalableAllows disparate programming languages andtechnology (db)Managed by different teams

Microservice Benefits - p2Can enable resiliencyComposable - caching, aggregation,proxies, gatewaysAllows fine grained monitoring andresource tuning

Microservice RisksDecomposing w/o domain knowledgeSiloed knowledge / skillsRapid change vs qualityDeploy / log complexityVersion compatibility

Does it work?

Monolith to MicroservicesNetflix - 37% web bandwidth peak, 1B APIcalls/day, 6 services/callAmazon - 100-150 service calls per web pageEbay - split over 75 business functional areas

Microservice OptimismMicroservices are becoming the

default style for building enterpriseapplications.

Balance Risk vs RewardEvolve architectureAutomate deployment, logmanagement, and monitoringResilient designPlan for scalability (human and hardware)

Evolving ArchitectureDecomposition - Functions, ModulesRedis Queue - Mail serviceRedis Reliable QueueRedis Cache - Ad generator

Evolving Architecture - p2Hapi API Gateway - ProxyHapi MicroserviceHapi API Gateway - EnhancedHapi Microservice using plugin

Going BeyondFrameworks - SenecaJSMessaging - KafkaStream services - AWS LambdaDynamic scaling / deploy -Kubernetes

Resources

slides, code, resources, notes@jeffbski and @codewindsjeff@codewinds.com

codewinds.com/nc2015

top related