SlideShare a Scribd company logo
1 of 24
Flux
Shyam Kumar Akirala
github.com/shyamakirala
What is a Workflow?
Set of tasks which need to complete sequentially or parallelly to achieve a business goal
Why Workflows?
● Better Insights
● To stitch tasks which coordinate work across multiple components
| long-running | may fail | time-out | require restarts
Flux
Is
● An Asynchronous, Distributed and Reliable state machine based orchestrator
● Used to build Stateful event-driven apps and workflows.
● Simple - Primitives, Deployment dependencies
Flux - Reactive, Event-driven
User
triggered
events
Flux
generated
events
Database
update
events
System
generated
events
Resources
Downstream
Systems
Programming Primitives
WorkFlow
Task
Few Rules
● All params and return values should implement Event interface
● Stateless Classes
● Immutable event objects in workflow method
● Workflow method must return void
Deployment Unit
Each Deployment Unit is loaded in Flux node using a separate class loader
Execution
when Workflow method is invoked in client environment, Flux client library intercepts the call and generates workflow
skeleton on the fly and submits the request to Flux runtime for execution.
Testability
● Unit and Integration Testing
○ As workflows are written in Java, Unit and Integration testing would be similar to writing them for
any other Java code
● Debugging through IDE
○ You can attach a debugger to Flux process to debug the workflow while development. Find more
details about it on https://github.com/flipkart-incubator/flux/wiki/Examples.
● Toggling between Async and Sync
○ Removing “FluxClientInterceptorModule” from your Guice Injector lets your code to run in Sync
mode. With this you can toggle between Async and Sync whenever you want.
Observability - Live cluster state
Observability - Aggregated Metrics per Workflow
JMX metrics from Flux code and client code
Observability - Individual FSM
Observability - Task state transitions
● Guarantees atleast-once execution of Tasks
○ Using durable states, transitions, events
● Local retries for timed-out executions and on Retriable exception
○ For @Task instances with ‘retries’ and ‘timeout’ attribute values - Retries executed on the
same Flux node
● Global retries for stalled state transitions using Redriver
○ For @Task instances with ‘retries’ and ‘timeout’ attribute values - Retries executed on any of
the Flux cluster nodes
Fault tolerance
When a seller initiated pack, we need to call and update various systems. Downstream systems involved are
1. Vendor Assignor - this generates a tracking id which has to be shown on the label printed on the shipment.
2. Accounting - to generate invoices and various other accounting entries
3. Doc Service - this creates a PDF consisting of the label and the invoice which has to be printed and attached in the shipment.
4. Logistics Compliance Engine - to generate various government forms required when a shipment has to cross state borders.
Flux orchestration is used in above scenarios.
Use Cases - Seller Fulfilment Service
Use Cases - outside FK
Tele-consultation service workflow of Helthface/Curefit. Actively running on AWS.
Use Cases - Helthface/Curefit - Health checkup using 3rd party provider
Feature Set
State Management
Async and Distributed processing
Fork & Join
Parallel processing
Correlation Id support
Retriable Errors
Configurable Retries & Timeouts
Versioning of workflows
At least once guarantees
Idempotency at workflow level
External and Scheduled events
Cancellation of ongoing Workflow
Metrics & Audit
Nested workflows
Dynamic conditional branching
Flux Runtimes
Design, Tech stack
Java
Google Guice
- Dependency Injection
Polyguice
- Lifecycle Management
Jetty
- API & UI servers
Akka
- Queueing & Retries
Hystrix
- Circuit breaker
- Timeouts
- Metrics
MySQL
- Data persistence
Managed Environment
Isolated Environment
https://github.com/flipkart-incubator/flux
flux-dev@flipkart.com
Documentation: https://github.com/flipkart-incubator/flux/wiki

More Related Content

What's hot

LandsEnd TechEd2016 (1)
LandsEnd TechEd2016 (1)LandsEnd TechEd2016 (1)
LandsEnd TechEd2016 (1)
Lisa Lawver
 
Flink Forward San Francisco 2019: Managing Flink on Kubernetes - FlinkK8sOper...
Flink Forward San Francisco 2019: Managing Flink on Kubernetes - FlinkK8sOper...Flink Forward San Francisco 2019: Managing Flink on Kubernetes - FlinkK8sOper...
Flink Forward San Francisco 2019: Managing Flink on Kubernetes - FlinkK8sOper...
Flink Forward
 
演算法期中段落報告
演算法期中段落報告演算法期中段落報告
演算法期中段落報告
Bernie Chiu
 

What's hot (20)

NCM Training - Part 2 - Automation, Notification, Compliance and Reports
NCM Training - Part 2 - Automation, Notification, Compliance and ReportsNCM Training - Part 2 - Automation, Notification, Compliance and Reports
NCM Training - Part 2 - Automation, Notification, Compliance and Reports
 
Automate SAP PI/PO Migration
Automate SAP PI/PO Migration Automate SAP PI/PO Migration
Automate SAP PI/PO Migration
 
LandsEnd TechEd2016 (1)
LandsEnd TechEd2016 (1)LandsEnd TechEd2016 (1)
LandsEnd TechEd2016 (1)
 
Thomson Reuters
Thomson ReutersThomson Reuters
Thomson Reuters
 
Application of the automation know-how within the EGS-CC project
Application of the automation know-how within the EGS-CC projectApplication of the automation know-how within the EGS-CC project
Application of the automation know-how within the EGS-CC project
 
Falcon grocery model 2014
Falcon grocery model 2014Falcon grocery model 2014
Falcon grocery model 2014
 
Flink Forward San Francisco 2019: Managing Flink on Kubernetes - FlinkK8sOper...
Flink Forward San Francisco 2019: Managing Flink on Kubernetes - FlinkK8sOper...Flink Forward San Francisco 2019: Managing Flink on Kubernetes - FlinkK8sOper...
Flink Forward San Francisco 2019: Managing Flink on Kubernetes - FlinkK8sOper...
 
Henk Boxma (Boxma IT) at Industry Leaders Forum 2015
Henk Boxma (Boxma IT) at Industry Leaders Forum 2015Henk Boxma (Boxma IT) at Industry Leaders Forum 2015
Henk Boxma (Boxma IT) at Industry Leaders Forum 2015
 
Optimizing your use of react life cycles by shedrack akintayo
Optimizing your use of react life cycles by shedrack akintayoOptimizing your use of react life cycles by shedrack akintayo
Optimizing your use of react life cycles by shedrack akintayo
 
BPM Suite 12c Launch - Focus on Developer Productivity
BPM Suite 12c Launch - Focus on Developer ProductivityBPM Suite 12c Launch - Focus on Developer Productivity
BPM Suite 12c Launch - Focus on Developer Productivity
 
SOA_BPM_12c_launch_event_BPM_track_developer_productivity_lucasjellema
SOA_BPM_12c_launch_event_BPM_track_developer_productivity_lucasjellemaSOA_BPM_12c_launch_event_BPM_track_developer_productivity_lucasjellema
SOA_BPM_12c_launch_event_BPM_track_developer_productivity_lucasjellema
 
When and how to migrate from a relational database to Cassandra
When and how to migrate from a relational database to CassandraWhen and how to migrate from a relational database to Cassandra
When and how to migrate from a relational database to Cassandra
 
Figaf pi auto migration 20191024 webinar
Figaf pi auto migration 20191024 webinarFigaf pi auto migration 20191024 webinar
Figaf pi auto migration 20191024 webinar
 
演算法期中段落報告
演算法期中段落報告演算法期中段落報告
演算法期中段落報告
 
VM Migration and Monitoring Software *SDLAB
VM Migration and Monitoring Software *SDLABVM Migration and Monitoring Software *SDLAB
VM Migration and Monitoring Software *SDLAB
 
VMware Monitoring-Discover And Monitor Your Virtual Environment
VMware Monitoring-Discover And Monitor Your Virtual EnvironmentVMware Monitoring-Discover And Monitor Your Virtual Environment
VMware Monitoring-Discover And Monitor Your Virtual Environment
 
Processing Large Datasets for the National Broadband Map with FME
Processing Large Datasets for the National Broadband Map with FMEProcessing Large Datasets for the National Broadband Map with FME
Processing Large Datasets for the National Broadband Map with FME
 
Processing Large Datasets for the National Broadband Map with FME
Processing Large Datasets for the National Broadband Map with FMEProcessing Large Datasets for the National Broadband Map with FME
Processing Large Datasets for the National Broadband Map with FME
 
Architecture Sustaining LINE Sticker services
Architecture Sustaining LINE Sticker servicesArchitecture Sustaining LINE Sticker services
Architecture Sustaining LINE Sticker services
 
Sprint 12
Sprint 12Sprint 12
Sprint 12
 

Similar to Flux - An open sourced Workflow orchestrator from Flipkart

Advanced Load Runner
Advanced Load RunnerAdvanced Load Runner
Advanced Load Runner
telab
 
Kafka Summit NYC 2017 - Scalable Real-Time Complex Event Processing @ Uber
Kafka Summit NYC 2017 - Scalable Real-Time Complex Event Processing @ UberKafka Summit NYC 2017 - Scalable Real-Time Complex Event Processing @ Uber
Kafka Summit NYC 2017 - Scalable Real-Time Complex Event Processing @ Uber
confluent
 
24. Advanced Transaction Processing in DBMS
24. Advanced Transaction Processing in DBMS24. Advanced Transaction Processing in DBMS
24. Advanced Transaction Processing in DBMS
koolkampus
 
How kubernetes operators can rescue dev secops in midst of a pandemic updated
How kubernetes operators can rescue dev secops in midst of a pandemic updatedHow kubernetes operators can rescue dev secops in midst of a pandemic updated
How kubernetes operators can rescue dev secops in midst of a pandemic updated
Shikha Srivastava
 
WF_in_retail_banking_enterprise_systems
WF_in_retail_banking_enterprise_systemsWF_in_retail_banking_enterprise_systems
WF_in_retail_banking_enterprise_systems
Oleh Zheleznyak
 

Similar to Flux - An open sourced Workflow orchestrator from Flipkart (20)

Scalability truths and serverless architectures
Scalability truths and serverless architecturesScalability truths and serverless architectures
Scalability truths and serverless architectures
 
Discover the real user experience with Alyvix - Icinga Camp Milan 2019
Discover the real user experience with Alyvix - Icinga Camp Milan 2019Discover the real user experience with Alyvix - Icinga Camp Milan 2019
Discover the real user experience with Alyvix - Icinga Camp Milan 2019
 
python_development.pptx
python_development.pptxpython_development.pptx
python_development.pptx
 
Copy of Silk performer - KT.pptx
Copy of Silk performer - KT.pptxCopy of Silk performer - KT.pptx
Copy of Silk performer - KT.pptx
 
Silk Performer Presentation v1
Silk Performer Presentation v1Silk Performer Presentation v1
Silk Performer Presentation v1
 
Advanced Load Runner
Advanced Load RunnerAdvanced Load Runner
Advanced Load Runner
 
Inventory management using temporal workflow engine
Inventory management using temporal workflow engineInventory management using temporal workflow engine
Inventory management using temporal workflow engine
 
Kafka Summit NYC 2017 - Scalable Real-Time Complex Event Processing @ Uber
Kafka Summit NYC 2017 - Scalable Real-Time Complex Event Processing @ UberKafka Summit NYC 2017 - Scalable Real-Time Complex Event Processing @ Uber
Kafka Summit NYC 2017 - Scalable Real-Time Complex Event Processing @ Uber
 
Consul and Consul Pusher
Consul and Consul PusherConsul and Consul Pusher
Consul and Consul Pusher
 
Kafka PPT.pptx
Kafka PPT.pptxKafka PPT.pptx
Kafka PPT.pptx
 
OSDC 2018 | From Monolith to Microservices by Paul Puschmann_
OSDC 2018 | From Monolith to Microservices by Paul Puschmann_OSDC 2018 | From Monolith to Microservices by Paul Puschmann_
OSDC 2018 | From Monolith to Microservices by Paul Puschmann_
 
Springboot Microservices
Springboot MicroservicesSpringboot Microservices
Springboot Microservices
 
Building workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration MondayBuilding workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration Monday
 
Data Con LA 2022 - Event Sourcing with Apache Pulsar and Apache Quarkus
Data Con LA 2022 - Event Sourcing with Apache Pulsar and Apache QuarkusData Con LA 2022 - Event Sourcing with Apache Pulsar and Apache Quarkus
Data Con LA 2022 - Event Sourcing with Apache Pulsar and Apache Quarkus
 
Why Serverless Flink Matters - Blazing Fast Stream Processing Made Scalable
Why Serverless Flink Matters - Blazing Fast Stream Processing Made ScalableWhy Serverless Flink Matters - Blazing Fast Stream Processing Made Scalable
Why Serverless Flink Matters - Blazing Fast Stream Processing Made Scalable
 
24. Advanced Transaction Processing in DBMS
24. Advanced Transaction Processing in DBMS24. Advanced Transaction Processing in DBMS
24. Advanced Transaction Processing in DBMS
 
PERFORMANCE TESTING USING LOAD RUNNER
PERFORMANCE  TESTING  USING  LOAD RUNNERPERFORMANCE  TESTING  USING  LOAD RUNNER
PERFORMANCE TESTING USING LOAD RUNNER
 
How kubernetes operators can rescue dev secops in midst of a pandemic updated
How kubernetes operators can rescue dev secops in midst of a pandemic updatedHow kubernetes operators can rescue dev secops in midst of a pandemic updated
How kubernetes operators can rescue dev secops in midst of a pandemic updated
 
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...
 
WF_in_retail_banking_enterprise_systems
WF_in_retail_banking_enterprise_systemsWF_in_retail_banking_enterprise_systems
WF_in_retail_banking_enterprise_systems
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 

Flux - An open sourced Workflow orchestrator from Flipkart

  • 2. What is a Workflow? Set of tasks which need to complete sequentially or parallelly to achieve a business goal
  • 3. Why Workflows? ● Better Insights ● To stitch tasks which coordinate work across multiple components | long-running | may fail | time-out | require restarts
  • 4. Flux Is ● An Asynchronous, Distributed and Reliable state machine based orchestrator ● Used to build Stateful event-driven apps and workflows. ● Simple - Primitives, Deployment dependencies
  • 5. Flux - Reactive, Event-driven User triggered events Flux generated events Database update events System generated events Resources Downstream Systems
  • 7. Few Rules ● All params and return values should implement Event interface ● Stateless Classes ● Immutable event objects in workflow method ● Workflow method must return void
  • 8. Deployment Unit Each Deployment Unit is loaded in Flux node using a separate class loader
  • 9. Execution when Workflow method is invoked in client environment, Flux client library intercepts the call and generates workflow skeleton on the fly and submits the request to Flux runtime for execution.
  • 10. Testability ● Unit and Integration Testing ○ As workflows are written in Java, Unit and Integration testing would be similar to writing them for any other Java code ● Debugging through IDE ○ You can attach a debugger to Flux process to debug the workflow while development. Find more details about it on https://github.com/flipkart-incubator/flux/wiki/Examples. ● Toggling between Async and Sync ○ Removing “FluxClientInterceptorModule” from your Guice Injector lets your code to run in Sync mode. With this you can toggle between Async and Sync whenever you want.
  • 11. Observability - Live cluster state
  • 12. Observability - Aggregated Metrics per Workflow JMX metrics from Flux code and client code
  • 14. Observability - Task state transitions
  • 15. ● Guarantees atleast-once execution of Tasks ○ Using durable states, transitions, events ● Local retries for timed-out executions and on Retriable exception ○ For @Task instances with ‘retries’ and ‘timeout’ attribute values - Retries executed on the same Flux node ● Global retries for stalled state transitions using Redriver ○ For @Task instances with ‘retries’ and ‘timeout’ attribute values - Retries executed on any of the Flux cluster nodes Fault tolerance
  • 16. When a seller initiated pack, we need to call and update various systems. Downstream systems involved are 1. Vendor Assignor - this generates a tracking id which has to be shown on the label printed on the shipment. 2. Accounting - to generate invoices and various other accounting entries 3. Doc Service - this creates a PDF consisting of the label and the invoice which has to be printed and attached in the shipment. 4. Logistics Compliance Engine - to generate various government forms required when a shipment has to cross state borders. Flux orchestration is used in above scenarios. Use Cases - Seller Fulfilment Service
  • 17. Use Cases - outside FK Tele-consultation service workflow of Helthface/Curefit. Actively running on AWS.
  • 18. Use Cases - Helthface/Curefit - Health checkup using 3rd party provider
  • 19. Feature Set State Management Async and Distributed processing Fork & Join Parallel processing Correlation Id support Retriable Errors Configurable Retries & Timeouts Versioning of workflows At least once guarantees Idempotency at workflow level External and Scheduled events Cancellation of ongoing Workflow Metrics & Audit Nested workflows Dynamic conditional branching
  • 21. Design, Tech stack Java Google Guice - Dependency Injection Polyguice - Lifecycle Management Jetty - API & UI servers Akka - Queueing & Retries Hystrix - Circuit breaker - Timeouts - Metrics MySQL - Data persistence

Editor's Notes

  1. Set of tasks which need to complete sequentially or parallelly to achieve a business goal