SlideShare a Scribd company logo
PRESENTED BY
PRESENTED BY
1 Introduction to Microservices with Hydra + Redis
Pros/cons of a microservice architecture, and how Hydra + Redis ease microservice development.
2 Making Microservices with Hydra
A quick guide to building microservices in NodeJS with the Hydra and Hydra-Express libraries.
3 Plugins, Docker, Hydra 2.0
Extending Hydra with the plugin system, using Hydra with Docker, and previewing Hydra 2.0.
Agenda:
PRESENTED BY
Microservices provide benefits but come with costs.
• Pros
– Strong Module Boundaries
– Independent Deployments
– Technological Diversity
• Cons
– Distribution
– Eventual Consistency
– Operational Complexity
• Further reading
– https://martinfowler.com/articles/microservice-trade-offs.html
1a. Introduction: Microservices?
PRESENTED BY
Hydra enables rapid development of microservices with a minimal learning curve.
• Hydra provides core microservice functionality
– service presence and health monitoring
– service discovery and inter-service requests
– routing and load balancing
• Hydra has a small API and minimal dependencies.
– Hydra could be implemented in other languages.
• Just need to follow the same Redis usage conventions
1b. Introduction: Why build Microservices with Hydra?
PRESENTED BY
Hydra uses Redis to power all core features.
• Health/presence
– Strings, Expiration, Scan/Match
• Service Discovery
– Per-service information in hash hydra:service:nodes
• Routes
– Per-service routes in set hydra:service:<name>:service:routes
• e.g. [post]/v1/service/foo or [get]/v1/service/bar
• Inter-service Messaging
– Pub/Sub
• Per-instance channel: hydra:service:mc:<name>:<id>
• Service-wide channel: hydra:service:mc:<name>
1c. Introduction: How does Hydra use Redis?
PRESENTED BY
What’s available in the Hydra NPM ecosystem?
• hydra
– Core microservice features
• hydra-express
– Leverage ExpressJS for HTTP APIs and web apps
• hydra-router
– service-aware router via HTTP and WebSockets
• hydra-cli
– eases common tasks like checking health logs and managing service configurations
• hydra-plugins
– e.g. auth, logging, RPC
2a. Making Microservices with Hydra: NPM Ecosystem
PRESENTED BY
Overview of Hydra’s core functions.
• init
– Loads config.json and connects to Redis, puts Hydra in “Consumer mode.”
• registerService
– Registers this instance as a service, puts Hydra in “Service mode.”
– Hydra will now update health and presence in Redis.
• registerRoutes
– Register API endpoints for this service.
• sendMessage
– Send routable messages to services (broadcast, service-wide, or by instance ID)
• makeAPIRequest
– Make API requests to registered routes
2b. Making Microservices with Hydra: Core API
PRESENTED BY
Easily re-use features via plugins.
• Plugins can target hydra core
– hydra-plugin-<name>
• or hydra-express
– hydra-express-plugin-<name>
Current plugins include…
• JWT auth
– hydra-express-plugin-jwt-auth
• Logging
– fwsp-logger
3a. Making Microservices with Hydra: Plugins
PRESENTED BY
• fwsp-docker-scripts
– Adding this to package.json scripts will add “docker build” and “docker push”
– Automatically generates a simple Dockerfile
• Redis configuration
– config.json can be packaged in the image or pulled from Redis
– HYDRA_REDIS_URL and HYDRA_SERVICE environment variables
– hydra-cli cfg push/pull
• Health checks
– /v1/<service>/health route should return hydra.getHealth()
3b. Docker and Hydra
PRESENTED BY
• TypeScript
• async/await
• ioredis
• redis 5.x features
3c. Hydra 2.0
Thank you!
Thank you!

More Related Content

PPTX
Redis Streams for Event-Driven Microservices
PPTX
Redis TimeSeries
PDF
Redis Tames The Caching Herd: Jon Hyman
PDF
A closer look to locaweb IaaS
PDF
Locaweb cloud and sdn
PDF
Por trás da infraestrutura do Cloud - Campus Party 2014
PPTX
RedisConf17 - Smartwaiver - Using Redis for Kiosk Registration Command and Co...
PDF
RedisConf17 - Explosion of Data at the Edge in Equinix
Redis Streams for Event-Driven Microservices
Redis TimeSeries
Redis Tames The Caching Herd: Jon Hyman
A closer look to locaweb IaaS
Locaweb cloud and sdn
Por trás da infraestrutura do Cloud - Campus Party 2014
RedisConf17 - Smartwaiver - Using Redis for Kiosk Registration Command and Co...
RedisConf17 - Explosion of Data at the Edge in Equinix

What's hot (20)

PPTX
SQL, Redis and Kubernetes by Paul Stanton of Windocks - Redis Day Seattle 2020
PDF
Creating a Kafka Topic. Super easy? | Andrew Stevenson and Marios Andreopoulo...
PDF
Kubernetes connectivity to Cloud Native Kafka | Evan Shortiss and Hugo Guerre...
PPTX
RedisConf18 - Redis Enterprise on Cloud Native Platforms
PPTX
Leveraging Redis for System Monitoring by Adam McCormick of SBG - Redis Day S...
PPTX
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
PDF
Building Scalable Real-Time Data Pipelines with the Couchbase Kafka Connector...
PDF
The Road Most Traveled: A Kafka Story | Heikki Nousiainen, Aiven
PPTX
HBaseConAsia2018 Track3-7: The application of HBase in New Energy Vehicle Mon...
PPTX
Big Data Quickstart Series 3: Perform Data Integration
PDF
DBaaS at Scale
PPTX
Solving Complex Scaling Problems by Prashant Kumar and Abhishek Jain of Myntr...
PDF
Mainframe Integration, Offloading and Replacement with Apache Kafka | Kai Wae...
PPTX
Kubernetes as Orchestrator for A10 Lightning Controller
PPTX
HIPAA Compliance in the Cloud
PDF
Cloud-based Linked Data Management for Self-service Application Development
PPTX
Keeping Analytics Data Fresh in a Streaming Architecture | John Neal, Qlik
PPTX
0-330km/h: Porsche's Data Streaming Journey | Sridhar Mamella, Porsche
PDF
Using Kafka as a Database For Real-Time Transaction Processing | Chad Preisle...
PDF
WSO2Con ASIA 2016: Deployment Patterns and Capacity Planning
 
SQL, Redis and Kubernetes by Paul Stanton of Windocks - Redis Day Seattle 2020
Creating a Kafka Topic. Super easy? | Andrew Stevenson and Marios Andreopoulo...
Kubernetes connectivity to Cloud Native Kafka | Evan Shortiss and Hugo Guerre...
RedisConf18 - Redis Enterprise on Cloud Native Platforms
Leveraging Redis for System Monitoring by Adam McCormick of SBG - Redis Day S...
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
Building Scalable Real-Time Data Pipelines with the Couchbase Kafka Connector...
The Road Most Traveled: A Kafka Story | Heikki Nousiainen, Aiven
HBaseConAsia2018 Track3-7: The application of HBase in New Energy Vehicle Mon...
Big Data Quickstart Series 3: Perform Data Integration
DBaaS at Scale
Solving Complex Scaling Problems by Prashant Kumar and Abhishek Jain of Myntr...
Mainframe Integration, Offloading and Replacement with Apache Kafka | Kai Wae...
Kubernetes as Orchestrator for A10 Lightning Controller
HIPAA Compliance in the Cloud
Cloud-based Linked Data Management for Self-service Application Development
Keeping Analytics Data Fresh in a Streaming Architecture | John Neal, Qlik
0-330km/h: Porsche's Data Streaming Journey | Sridhar Mamella, Porsche
Using Kafka as a Database For Real-Time Transaction Processing | Chad Preisle...
WSO2Con ASIA 2016: Deployment Patterns and Capacity Planning
 
Ad

Similar to Building Lightweight Microservices With Redis & Hydra (20)

PPTX
Microservices
PPT
TransitioningToMicroServonDocker_MS
PPSX
Building Modern Digital Services on Scalable Private Government Infrastructur...
PPTX
Azure Modern Cloud App Development Approaches 2017
PPTX
WSO2 Workshop Sydney 2016 - Microservices
PPTX
Make your Microservices sing! Presentation from Oracle Code
PPTX
Make your Microservices sing!
PPT
web services-May 25.ppt
PDF
Rami Sayar - Node microservices with Docker
PPTX
Monolithic and Microservice architecture, Feature of Node JS 10, HTTP2
PDF
Structure and Opinions - Software Deployments with Cloud Foundry
PPTX
Oow2016 review--paas-microservices-
PPTX
Building Services with WSO2 Application Server and WSO2 Microservices Framewo...
PDF
[WSO2Con EU 2017] Microservices for Enterprises
 
PPTX
DevOpsVersion2
PPTX
Introduction to microservices
PPTX
Monoliths to Microservices with Jave EE and Spring Boot
PPTX
Microservices
PPTX
Microservices and Best Practices
PDF
Node.js Microservices Building Scalable and Reliable Applications.pdf
Microservices
TransitioningToMicroServonDocker_MS
Building Modern Digital Services on Scalable Private Government Infrastructur...
Azure Modern Cloud App Development Approaches 2017
WSO2 Workshop Sydney 2016 - Microservices
Make your Microservices sing! Presentation from Oracle Code
Make your Microservices sing!
web services-May 25.ppt
Rami Sayar - Node microservices with Docker
Monolithic and Microservice architecture, Feature of Node JS 10, HTTP2
Structure and Opinions - Software Deployments with Cloud Foundry
Oow2016 review--paas-microservices-
Building Services with WSO2 Application Server and WSO2 Microservices Framewo...
[WSO2Con EU 2017] Microservices for Enterprises
 
DevOpsVersion2
Introduction to microservices
Monoliths to Microservices with Jave EE and Spring Boot
Microservices
Microservices and Best Practices
Node.js Microservices Building Scalable and Reliable Applications.pdf
Ad

More from Redis Labs (20)

PPTX
Redis Day Bangalore 2020 - Session state caching with redis
PPTX
Protecting Your API with Redis by Jane Paek - Redis Day Seattle 2020
PPTX
The Happy Marriage of Redis and Protobuf by Scott Haines of Twilio - Redis Da...
PPTX
Rust and Redis - Solving Problems for Kubernetes by Ravi Jagannathan of VMwar...
PPTX
Redis for Data Science and Engineering by Dmitry Polyakovsky of Oracle
PPTX
Practical Use Cases for ACLs in Redis 6 by Jamie Scott - Redis Day Seattle 2020
PPTX
JSON in Redis - When to use RedisJSON by Jay Won of Coupang - Redis Day Seatt...
PPTX
Highly Available Persistent Session Management Service by Mohamed Elmergawi o...
PPTX
Anatomy of a Redis Command by Madelyn Olson of Amazon Web Services - Redis Da...
PPTX
Building a Multi-dimensional Analytics Engine with RedisGraph by Matthew Goos...
PPTX
RediSearch 1.6 by Pieter Cailliau - Redis Day Bangalore 2020
PPTX
RedisGraph 2.0 by Pieter Cailliau - Redis Day Bangalore 2020
PPTX
RedisTimeSeries 1.2 by Pieter Cailliau - Redis Day Bangalore 2020
PPTX
RedisAI 0.9 by Sherin Thomas of Tensorwerk - Redis Day Bangalore 2020
PPTX
Rate-Limiting 30 Million requests by Vijay Lakshminarayanan and Girish Koundi...
PDF
Three Pillars of Observability by Rajalakshmi Raji Srinivasan of Site24x7 Zoh...
PPTX
Redis as a High Scale Swiss Army Knife by Rahul Dagar and Abhishek Gupta of G...
PPTX
Deploying Redis as a Sidecar in Kubernetes by Janakiram MSV - Redis Day Banga...
PPTX
Moving Beyond Cache by Yiftach Shoolman - Redis Day Bangalore 2020
PPTX
Real-time GeoSearching at Scale with RediSearch by Apoorva Gaurav and Ronil M...
Redis Day Bangalore 2020 - Session state caching with redis
Protecting Your API with Redis by Jane Paek - Redis Day Seattle 2020
The Happy Marriage of Redis and Protobuf by Scott Haines of Twilio - Redis Da...
Rust and Redis - Solving Problems for Kubernetes by Ravi Jagannathan of VMwar...
Redis for Data Science and Engineering by Dmitry Polyakovsky of Oracle
Practical Use Cases for ACLs in Redis 6 by Jamie Scott - Redis Day Seattle 2020
JSON in Redis - When to use RedisJSON by Jay Won of Coupang - Redis Day Seatt...
Highly Available Persistent Session Management Service by Mohamed Elmergawi o...
Anatomy of a Redis Command by Madelyn Olson of Amazon Web Services - Redis Da...
Building a Multi-dimensional Analytics Engine with RedisGraph by Matthew Goos...
RediSearch 1.6 by Pieter Cailliau - Redis Day Bangalore 2020
RedisGraph 2.0 by Pieter Cailliau - Redis Day Bangalore 2020
RedisTimeSeries 1.2 by Pieter Cailliau - Redis Day Bangalore 2020
RedisAI 0.9 by Sherin Thomas of Tensorwerk - Redis Day Bangalore 2020
Rate-Limiting 30 Million requests by Vijay Lakshminarayanan and Girish Koundi...
Three Pillars of Observability by Rajalakshmi Raji Srinivasan of Site24x7 Zoh...
Redis as a High Scale Swiss Army Knife by Rahul Dagar and Abhishek Gupta of G...
Deploying Redis as a Sidecar in Kubernetes by Janakiram MSV - Redis Day Banga...
Moving Beyond Cache by Yiftach Shoolman - Redis Day Bangalore 2020
Real-time GeoSearching at Scale with RediSearch by Apoorva Gaurav and Ronil M...

Recently uploaded (20)

PDF
Empathic Computing: Creating Shared Understanding
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
 
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
 
PDF
Machine learning based COVID-19 study performance prediction
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Cloud computing and distributed systems.
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
cuic standard and advanced reporting.pdf
Empathic Computing: Creating Shared Understanding
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
 
Spectral efficient network and resource selection model in 5G networks
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Unlocking AI with Model Context Protocol (MCP)
The Rise and Fall of 3GPP – Time for a Sabbatical?
 
Machine learning based COVID-19 study performance prediction
Review of recent advances in non-invasive hemoglobin estimation
Cloud computing and distributed systems.
Building Integrated photovoltaic BIPV_UPV.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Big Data Technologies - Introduction.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Understanding_Digital_Forensics_Presentation.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
cuic standard and advanced reporting.pdf

Building Lightweight Microservices With Redis & Hydra

  • 2. PRESENTED BY 1 Introduction to Microservices with Hydra + Redis Pros/cons of a microservice architecture, and how Hydra + Redis ease microservice development. 2 Making Microservices with Hydra A quick guide to building microservices in NodeJS with the Hydra and Hydra-Express libraries. 3 Plugins, Docker, Hydra 2.0 Extending Hydra with the plugin system, using Hydra with Docker, and previewing Hydra 2.0. Agenda:
  • 3. PRESENTED BY Microservices provide benefits but come with costs. • Pros – Strong Module Boundaries – Independent Deployments – Technological Diversity • Cons – Distribution – Eventual Consistency – Operational Complexity • Further reading – https://martinfowler.com/articles/microservice-trade-offs.html 1a. Introduction: Microservices?
  • 4. PRESENTED BY Hydra enables rapid development of microservices with a minimal learning curve. • Hydra provides core microservice functionality – service presence and health monitoring – service discovery and inter-service requests – routing and load balancing • Hydra has a small API and minimal dependencies. – Hydra could be implemented in other languages. • Just need to follow the same Redis usage conventions 1b. Introduction: Why build Microservices with Hydra?
  • 5. PRESENTED BY Hydra uses Redis to power all core features. • Health/presence – Strings, Expiration, Scan/Match • Service Discovery – Per-service information in hash hydra:service:nodes • Routes – Per-service routes in set hydra:service:<name>:service:routes • e.g. [post]/v1/service/foo or [get]/v1/service/bar • Inter-service Messaging – Pub/Sub • Per-instance channel: hydra:service:mc:<name>:<id> • Service-wide channel: hydra:service:mc:<name> 1c. Introduction: How does Hydra use Redis?
  • 6. PRESENTED BY What’s available in the Hydra NPM ecosystem? • hydra – Core microservice features • hydra-express – Leverage ExpressJS for HTTP APIs and web apps • hydra-router – service-aware router via HTTP and WebSockets • hydra-cli – eases common tasks like checking health logs and managing service configurations • hydra-plugins – e.g. auth, logging, RPC 2a. Making Microservices with Hydra: NPM Ecosystem
  • 7. PRESENTED BY Overview of Hydra’s core functions. • init – Loads config.json and connects to Redis, puts Hydra in “Consumer mode.” • registerService – Registers this instance as a service, puts Hydra in “Service mode.” – Hydra will now update health and presence in Redis. • registerRoutes – Register API endpoints for this service. • sendMessage – Send routable messages to services (broadcast, service-wide, or by instance ID) • makeAPIRequest – Make API requests to registered routes 2b. Making Microservices with Hydra: Core API
  • 8. PRESENTED BY Easily re-use features via plugins. • Plugins can target hydra core – hydra-plugin-<name> • or hydra-express – hydra-express-plugin-<name> Current plugins include… • JWT auth – hydra-express-plugin-jwt-auth • Logging – fwsp-logger 3a. Making Microservices with Hydra: Plugins
  • 9. PRESENTED BY • fwsp-docker-scripts – Adding this to package.json scripts will add “docker build” and “docker push” – Automatically generates a simple Dockerfile • Redis configuration – config.json can be packaged in the image or pulled from Redis – HYDRA_REDIS_URL and HYDRA_SERVICE environment variables – hydra-cli cfg push/pull • Health checks – /v1/<service>/health route should return hydra.getHealth() 3b. Docker and Hydra
  • 10. PRESENTED BY • TypeScript • async/await • ioredis • redis 5.x features 3c. Hydra 2.0