LIGHT

  • News
  • Docs
  • Community
  • Reddit
  • GitHub
Star

SideCar

One of the main features for light-4j frameworks is separating the cross-cutting concerns from the business logic so that developers can focus on the business API handler implementations and DevOps can focus on the cross-cutting concerns in the pipeline for deployment.

All cross-cutting concerns are implemented as middleware handlers that can be plugged into the HTTP request/response chain. All of them group together to form a flexible gateway to protect the API handler implementations.

These plugins can be embedded in the same process in the API implementation as an embedded gateway. However, this might limit API implementation on the light-4j frameworks.

embedded

To support other frameworks and languages, we can deploy the light-proxy container as a sidecar along with API implementation.

proxy

When using the light-proxy as a sidecar in a Kubernetes pod, the light-proxy is acting as a micro gateway. It is not only a reverse proxy to address all the HTTP cross-cutting concerns, but also it can help with cross-cutting concerns for other system integration.

For example, by leveraging the handlers in light-kafka on the proxy instance, we can translate the Kafka protocol to HTTP to interact with Kafka with REST API for backend service. Simultaneously, the proxy will address the messaging level of cross-cutting concerns for the producer and consumer.

Another example is the mainframe integration. Instead of each API to handle the IMS connect, we can let the proxy do the translation, address common cross-cutting concerns and expose HTTP API to the back-end service to send requests.

The following diagram describes the usage.

kafka

This configuration ensures that the cross-cutting concerns are standardized in the organization. For all the Kafka related cross-cutting concerns, please visit light-kafka.

For example, if the business API wants to send a message to a Kafka topic, it can call the sidecar KafkaProduer REST endpoint with a topic, key, and value as the request body. The sidecar will send the key/value to the Kafka topic and at the same time inject cross-cutting concerns ProducerRecord headers.

The advantage of using the sidecar is that the backend API can be implemented in any framework and language. The developers don’t need to have the knowledge to work with Kafka and don’t need to worry about the cross-cutting concerns.

The disadvantage of using the sidecar is that the business API won’t fully control the Kafka produce and consumer. In the case that business API wants to have full control, it is recommended to implement with Light-Kafka.

  • About Light
    • Overview
    • Testimonials
    • What is Light
    • Features
    • Principles
    • Benefits
    • Roadmap
    • Community
    • Articles
    • Videos
    • License
    • Why Light Platform
  • Getting Started
    • Get Started Overview
    • Environment
    • Light Codegen Tool
    • Light Rest 4j
    • Light Tram 4j
    • Light Graphql 4j
    • Light Hybrid 4j
    • Light Eventuate 4j
    • Light Oauth2
    • Light Portal Service
    • Light Proxy Server
    • Light Router Server
    • Light Config Server
    • Light Saga 4j
    • Light Session 4j
    • Webserver
    • Websocket
    • Spring Boot Servlet
  • Architecture
    • Architecture Overview
    • API Category
    • API Gateway
    • Architecture Patterns
    • CQRS
    • Eco System
    • Event Sourcing
    • Fail Fast vs Fail Slow
    • Integration Patterns
    • JavaEE declining
    • Key Distribution
    • Microservices Architecture
    • Microservices Monitoring
    • Microservices Security
    • Microservices Traceability
    • Modular Monolith
    • Platform Ecosystem
    • Plugin Architecture
    • Scalability and Performance
    • Serverless
    • Service Collaboration
    • Service Mesh
    • SOA
    • Spring is bloated
    • Stages of API Adoption
    • Transaction Management
    • Microservices Cross-cutting Concerns Options
    • Service Mesh Plus
    • Service Discovery
  • Design
    • Design Overview
    • Design First vs Code First
    • Desgin Pattern
    • Service Evolution
    • Consumer Contract and Consumer Driven Contract
    • Handling Partial Failure
    • Idempotency
    • Server Life Cycle
    • Environment Segregation
    • Database
    • Decomposition Patterns
    • Http2
    • Test Driven
    • Multi-Tenancy
    • Why check token expiration
    • WebServices to Microservices
  • Cross-Cutting Concerns
    • Concerns Overview
  • API Styles
    • Light-4j for absolute performance
    • Style Overview
    • Distributed session on IMDG
    • Hybrid Serverless Modularized Monolithic
    • Kafka - Event Sourcing and CQRS
    • REST - Representational state transfer
    • Web Server with Light
    • Websocket with Light
    • Spring Boot Integration
    • Single Page Application
    • GraphQL - A query language for your API
    • Light IBM MQ
    • Light AWS Lambda
    • Chaos Monkey
  • Infrastructure Services
    • Service Overview
    • Light Proxy
    • Light Mesh
    • Light Router
    • Light Portal
    • Messaging Infrastructure
    • Centralized Logging
    • COVID-19
    • Light OAuth2
    • Metrics and Alerts
    • Config Server
    • Tokenization
    • Light Controller
  • Tool Chain
    • Tool Chain Overview
  • Utility Library
  • Service Consumer
    • Service Consumer
  • Development
    • Development Overview
  • Deployment
    • Deployment Overview
    • Frontend Backend
    • Linux Service
    • Windows Service
    • Install Eventuate on Windows
    • Secure API
    • Client vs light-router
    • Memory Limit
    • Deploy to Kubernetes
  • Benchmark
    • Benchmark Overview
  • Tutorial
    • Tutorial Overview
  • Troubleshooting
    • Troubleshoot
  • FAQ
    • FAQ Overview
  • Milestones
  • Contribute
    • Contribute to Light
    • Development
    • Documentation
    • Example
    • Tutorial
“SideCar” was last updated: December 3, 2020: fixes #217 add light-proxy sidecar support for Kafka (4cd883b)
Improve this page
  • News
  • Docs
  • Community
  • Reddit
  • GitHub
  • About Light
  • Getting Started
  • Architecture
  • Design
  • Cross-Cutting Concerns
  • API Styles
  • Infrastructure Services
  • Tool Chain
  • Utility Library
  • Service Consumer
  • Development
  • Deployment
  • Benchmark
  • Tutorial
  • Troubleshooting
  • FAQ
  • Milestones
  • Contribute