favorite terminal app or: iTerm2 / Hyper.js • NodeJS: https://nodejs.org * Requires Node 6.2.1 or greater • Lastly, if you’re cruising along - help the person sitting next to you!
a kind of thing really well • A distributed computing application - works across a network • Commonly implemented using ExpressJS and other lesser known frameworks
test • Cons: • can become too large for anyone on the team to fully understand • can be fragile due to the fact that a single error can take down the entire system • can be difficult to modify as modules are tightly coupled • can be difficult to build using remote teams • often requires the same tech stack
easier / safer to modify • can be easy to deploy • can be easy to test since you’re focused on a particular set of functionality • can be built using different tech stacks • Cons: • can be difficult to test due to its distributed nature • routing endpoints can require more consideration • services may need to discover one another
applications - such as microservices • It addresses distributed computing concerns so you won’t have to • Open Source project - released by Flywheel Sports • Related projects: hydra-express, hydra-router
discovery • Inter-service (P2P) communication with support for socket messaging and RESTful interfaces • Built-in load balancing and routing • Self registration with near zero configuration • Built-in job queues • Built on Node using native ES6 • Great with Docker
docs at: https://github.com/flywheelsports/hydra-cli A command line interface for Hydra services Commands: help - this help list config - configure connection to redis config list - display current configuration health [serviceName] - display service health healthlog serviceName - display service health log message create - create a message object message send message.json - send a message nodes [serviceName] - display service instance nodes rest path [payload.json] - make an HTTP RESTful call to a service routes [serviceName] - display service API routes services [serviceName] - display list of services
{ var express = hydraExpress.getExpress(); var api = express.Router(); api.get('/', function(req, res) { res.send('Hello World!'); }); hydraExpress.registerRoutes({ '': api }); } hydraExpress.init(config, onRegisterRoutes); var express = require('express') var app = express() app.get('/', function (req, res) { res.send('Hello World!') }) app.listen(3000, function () { console.log('Example app listening on port 3000!') }) Side by side comparison