PARTICULUM MOBILE: ZEND EXPRESSIVE MICROSERVICES IN . - GitHub Pages

Transcription

PARTICULUM MOBILE:ZEND EXPRESSIVE MICROSERVICES INDOCKER SWARMJan BurklSolution Consulting ManagerRogue Wave Softwarephp.ruhr 2017, Dortmund, November 9th 2017

ZEND EXPRESSIVE

EXPRESSIVE 2.0The PHP framework for Middleware applicationsPSR-7 HTTP Message support (using zenddiactoros)Support of lambda middleware (PSR-15) anddouble pass ( request, response, next)Piping workflow (using zend-stratigility)Features: routing, dependency injection,templating, error handlingLast release 2.0.3, 28th March 2017

MIDDLEWAREA function that gets a request and generates aresponseuse Psr\Http\Message\ServerRequestInterface as Request;use nction (Request request, DelegateInterface next){// doing something with request.// for instance calling the delegate middleware next response next- process( request);// manipulate the responsereturn response;}

INSTALLATIONYou can install Expressive 2.0 using composer:composer create-project zendframework/zend-expressive-skeleChoose the default options during the installation

PARTICULUM MOBILE

PERPETUUM MOBILE / FREE ENERGYPerpetual Motion - Free EnergyYour browser does not currently recognize any of the video formats available.Click here to visit our frequently asked questions about HTML5 video.0:21 / 1:38

itbucket.org/5square-rw/particulum-mobile-master

MICROSERVICES“[.] a collection of loosely icesNo Standard DefinitionNo SpecificationNot specific to any Technology

DOCKERMICROSERVICE ARCHITECTURALSTYLE“[.] a suite of small services, eachrunning in its own process andcommunicating with lightweightmechanisms, often an HTTP ces.html

DOCKER COMPOSE

DOCKER SWARM (MODE)“Current versions of Docker includeswarm mode for natively managing acluster of Docker Engines called aswarm. Use the Docker CLI to create aswarm, deploy application services toa swarm, and manage swarmbehavior.”

MY LOCAL SETUPVirtualBoxVagrant3 NodesUbuntu 16

INIT / MANAGER docker swarm init --advertise-addr 192.168.99.121

Swarm initialized: current node (bvz81updecsj6wjz393c09vti) isTo add a worker to this swarm, run the following command:docker swarm join \--token 17.0.2:2377To add a manager to this swarm, run 'docker swarm join-token

ROUTING MESH“The routing mesh enables each nodein the swarm to accept connectionson published ports for any servicerunning in the swarm, even if there’sno task running on the node.”

INGRESS s/

DEPLOYMENT

DOCKER COMPOSE V3

DEV

PROD

docker stack deploy --compose-file stack.yml pmInstall and Update

BUILDING (AND PUSHING)IMAGES

BUILD docker build -t particulum-mobile/backend .

DOCKER-COMPOSEbuilds images on-the-fly

MAKEFILE

CI AAS(TravisCI)CodehipWerckerCodefreshetc.

DEMOParticulum Mobile, Portainer, Visualizer

SCALABLE MICROSERVICESession Handling?

ONE STEP BEYOND

WHAT DO WE HAVE?

WHAT DO WE WANT?

WHY?

PRIORIZATIONBrowser request limitRequest queueing on server sideJust a Docker Compose file modification

BENEFITS 1/2Docker Swarm (& Compose)See above System Setup Config in VCSModularConsistent Stack

BENEFITS 2/2ExpressiveLightweightNo Framework SiloModularBack to the Roots

DANKESCHÖNContact me: jan.burkl [at] roguewave.comFollow me: @janatzendSlides: 5square.de/talks

ZEND EXPRESSIVE MICROSERVICES IN DOCKER SWARM Jan Burkl Solution Consulting Manager , Dortmund, November 9th 2017 Rogue Wave Software php.ruhr 2017. ZEND EXPRESSIVE. . BUILDING (AND PUSHING) IMAGES. BUILD docker build -t particulum-mobile/backend . DOCKER-COMPOSE builds images on-the-fly. MAKEFILE. CI AAS (TravisCI) Codehip Wercker Codefresh