SlideShare une entreprise Scribd logo
1  sur  38
Télécharger pour lire hors ligne
Exploring Stateful Microservices
in the
Cloud Native World
Mary Grygleski & Grace Jansen
@mgrygles April 2022 @gracejansen27
Who is Grace Jansen?
• Developer Advocate at IBM
• Java, Cloud-Native, Reactive,
MicroProfile, Open Source
• A Biologist turned software engineer
• Passionate about encouraging more WIT
• Love traveling and trying new activities
Who is Mary Grygleski?
• Senior Developer Advocate at DataStax
• Streaming, Event-Driven, NoSQL, Open Source
• Java Champion
• Over 25 years of software engineering experience that
span a wide spectrum from product development to
enterprise applications and beyond
• Previously a Senior Developer Advocate at IBM
• President of Chicago Java Users Group (CJUG)
• Active church volunteer and religious education
teacher
Stateful
Vs
Stateless
“Computing” Life used
to be simpler
Stateless Computing
• State of the data does not get recorded between
transactions
A communication protocol that does not
retain any session information
• Scaling the system is easier
• Recoverability from system failure is easier
Architecture, design and
implementation is simpler
Realistically,
we live in a
Stateful
world
Stateful Computing
• State of the data gets recorded
at every step across all
transactions
A communication
protocol that would
retain all session
information
• Scaling the system is difficult
• Recoverability from system
failure involves a lot of efforts
Architecture,
design and
implementation is
complex
The States of Data
3 fundamental state of data:
● Data at rest
● Data in motion
● Data in use
The role of Microservices for the Data
● Microservices is a place where we “operate” on the data
● READ/WRITE: fetch from/place into the “data source”
● Data source: disk, in-memory, “cloud”
● Where I/O gets triggered to happen!
● Where transformation/remediation occur
Statefulness in the
“cloud-less” days…
Client-Server
Systems
Stateful database
systems on the
server side
Database-styled
transactions
2-Phase Commit
(2PC)
Java
Enterprise Java
Beans – Stateful EJB
(Session vs Entity
Beans)
Servlet –
HTTPSession
Client-side
caching of server
responses
Cookie-based
authentication
Token-based
authentication
(JWT)
Stateful
Microservices
in Cloud Native
environments
Cloud Native:
Stateless
containers?
Cloud Native Computing: An
overarching approach
► Essentially an “extension” to Cloud Computing by addressing the true
needs of enterprise-level distributed business application systems.
► What are the true needs? Netflix coined the term Cloud Native in the
early 2010’s and essentially they wanted to leverage on the cloud to
meet their goals for their systems to be:
► Highly available
► Scalable
► Performant
The 12 Factor Application
A methodology that was drafted by developers at Heroku.
A set of guidelines or best practices for portable and resilient applications that
are well suited to be in cloud environments.
One of the factors indicates the need for self-contained services which are
to be deployed as stateless processes. Microservices architecture (so far) is
one that can satisfy such a requirement.
It does not enforce the tools and libraries that the applications must use, but it
provides the solid concepts that the applications must follow.
The 12 Factor Application
• VII. Port binding
• Export services via port binding
• VIII. Concurrency
• Scale out via the process model
• IX. Disposability
• Maximize robustness with fast startup and
graceful shutdown
• X. Dev/prod parity
• Keep development, staging, and production as
similar as possible
• XI. Logs
• Treat logs as event streams
• XII. Admin processes
• Run admin/management tasks as one-off
processes
• I. Codebase
• One codebase tracked in revision control,
many deploys
• II. Dependencies
• Explicitly declare and isolate dependencies
• III. Config
• Store config in the environment
• IV. Backing services
• Treat backing services as attached resources
• V. Build, release, run
• Strictly separate build and run stages
• VI. Processes
• Execute the app as one or more stateless
processes
HOW to preserve state
across session, transaction,
and network boundaries?
Techniques / Mechanisms
Cache
Database-style
transactions Cookies
Sessions Tokens
Leader Election
(etcd) StatefulSets PersistentVolume
Cookie/Session
affinity (sticky
session)
Cloud Native Infrastructure:
Containers/Kubernetes
This Photo by Unknown Author is licensed under CC BY This Photo by Unknown Author is licensed under CC BY-SA-NC This Photo by Unknown Author
is licensed under CC BY-SA
This Photo by Unknown Author is licensed under CC BY-SA-NC
Programming Design Pattern
Saga
Transactions spanning across multiple services
Concept of compensation – no ”rollbacks”
(forward strategy)
2 ways of coordination sagas:
•Choreography
•Orchestration
Long-Running Action / Saga
Interaction Pattern
“Compensator” model
Example Library implementing LRA:
•MicroProfile LRA (1.0 – May 13, 2021)
An example of a SAGA (choreography)
What
about
Reactive?
Reactive Systems and the Reactive Manifesto
Resilient
Elastic
Message-Driven
Responsive
Code
samples
Open Liberty session persistence labs
Interactive Lab version:
https://openliberty.io/guides/#persistence
Apache Pulsar and Pulsar Functions
Free-Tier Astra Cloud: https://astra.datastax.com
● Separation of Compute and Data Storage (Apache
BookKeeper)
● Native from the start as a cloud-native provider
○ Multi-tenancy
○ Geo-replication
Resources
and Links
Resources (Code samples, Design Patterns, Open Source Libraries)
● Code samples:
○ Open Liberty session persistence using JCache & Hazelcast
https://openliberty.io/guides/sessions.html
○ A Stateful Open Liberty application in Kubernetes
https://github.com/mgrygles/stateful-kube-demo
Saga Design Pattern: https://microservices.io/patterns/data/saga.html
MicroProfile LRA 1.0:
https://download.eclipse.org/microprofile/microprofile-lra-1.0/microprofile-lra-spec-
1.0.html
LRA Blog: MicroProfile Long Running Actions in Open Liberty
● Open Liberty: https://openliberty.io/
○ Free tutorials/Guides: https://openliberty.io/guides
● MicroProfile: http://microprofile.io/
● Jakarta EE: https://jakarta.ee/
Resources (Cloud, Cloud-Native, DevOps)
● IBM Developer (all topics): https://developer.ibm.com
● IBM Developer (Cloud): https://developer.ibm.com/depmodels/cloud/
● IBM Developer (Cloud DevOps): https://www.ibm.com/cloud/devops
● IBM Developer (Cloud Native): https://www.ibm.com/cloud/cloud-native/
● IBM Developer (Saga Pattern):
https://developer.ibm.com/articles/use-saga-to-solve-distributed-transaction-management-pr
oblems-in-a-microservices-architecture/
● Programming with Java on IBM Cloud (IBM Cloud Docs):
https://cloud.ibm.com/docs/java?topic=cloud-native-overview
● Cloud Native Computing Foundation (CNCF): https://github.com/cncf/
● The 12 Factor App (Cloud Native Best Practices): https://12factor.net/
Resources (Apache Pulsar, Cassandra, AstraDB, Astra Streaming)
Astra Streaming:
https://www.datastax.com/products/astra-streaming
Luna Streaming:
https://www.datastax.com/products/luna-streaming
Astra Cloud (free-tier Managed Cassandra on the Cloud):
https://astra.datastax.com/
https://pulsar.apache.org/
https://bookkeeper.apache.org/
https://zookeeper.apache.org
Managed Cassandra on the IBM Cloud
https://www.ibm.com/cloud/databases-for-datastax
Other Great Devnexus Sessions:
Join our community meetups & free trainings
IBM Expert TV: https://techtv.bemyapp.com/
IBM Developer on Meetup.com (includes all IBM Developer meetup groups in cities all over the world!)
https://www.meetup.com/pro/ibmdeveloper/
DataStax YouTube Channel: https://www.youtube.com/c/DataStax
Highly recommended also:
Chicago Java Users Group (CJUG) https://www.meetup.com/ChicagoJUG/
Follow Mary’s Twitch Stream
(Different topics: Java, Open Source, Distributed Messaging, Event-Streaming, Cloud, DevOps, etc)
Wednesday at 2pm-US/Central
https://twitch.tv/mgrygles
Join Pulsar at the ‘hood
https://www.meetup.com/pro/apache-pulsar-neighborhood
https://pulsar-neighborhood.github.io/
Join Mary on
Discord
https://discord.gg/RMU4Juw
Thank You!
@mgrygles
https://linkedin.com/in/mary-grygleski
https://github.com/mgrygles
https://dev.to/mgrygles
@gracejansen27
https://linkedin.com/in/grace-jansen
https://github.com/GraceJanse
https://developer.ibm.com/profiles/grace.jansen1/

Contenu connexe

Similaire à 2022-Devnexus-StatefulMicroservices.pptx.pdf

Google Tech Talk with Dr. Eric Brewer in Korea Apr.27.2015
Google Tech Talk with Dr. Eric Brewer in Korea Apr.27.2015Google Tech Talk with Dr. Eric Brewer in Korea Apr.27.2015
Google Tech Talk with Dr. Eric Brewer in Korea Apr.27.2015
Chris Jang
 
Optimizing the Ops in DevOps
Optimizing the Ops in DevOpsOptimizing the Ops in DevOps
Optimizing the Ops in DevOps
Gordon Haff
 

Similaire à 2022-Devnexus-StatefulMicroservices.pptx.pdf (20)

Data Engineer, Patterns & Architecture The future: Deep-dive into Microservic...
Data Engineer, Patterns & Architecture The future: Deep-dive into Microservic...Data Engineer, Patterns & Architecture The future: Deep-dive into Microservic...
Data Engineer, Patterns & Architecture The future: Deep-dive into Microservic...
 
12 Factor App Methodology
12 Factor App Methodology12 Factor App Methodology
12 Factor App Methodology
 
Google Tech Talk with Dr. Eric Brewer in Korea Apr.27.2015
Google Tech Talk with Dr. Eric Brewer in Korea Apr.27.2015Google Tech Talk with Dr. Eric Brewer in Korea Apr.27.2015
Google Tech Talk with Dr. Eric Brewer in Korea Apr.27.2015
 
MongoDB World 2018: MongoDB and Cloud Foundry – A Match Made for the Cloud
MongoDB World 2018: MongoDB and Cloud Foundry – A Match Made for the CloudMongoDB World 2018: MongoDB and Cloud Foundry – A Match Made for the Cloud
MongoDB World 2018: MongoDB and Cloud Foundry – A Match Made for the Cloud
 
Optimizing the Ops in DevOps
Optimizing the Ops in DevOpsOptimizing the Ops in DevOps
Optimizing the Ops in DevOps
 
A Tight Ship: How Containers and SDS Optimize the Enterprise
 A Tight Ship: How Containers and SDS Optimize the Enterprise A Tight Ship: How Containers and SDS Optimize the Enterprise
A Tight Ship: How Containers and SDS Optimize the Enterprise
 
CNCF Introduction - Feb 2018
CNCF Introduction - Feb 2018CNCF Introduction - Feb 2018
CNCF Introduction - Feb 2018
 
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
 
Your Journey to Cloud-Native Begins with DevOps, Microservices, and Containers
Your Journey to Cloud-Native Begins with DevOps, Microservices, and ContainersYour Journey to Cloud-Native Begins with DevOps, Microservices, and Containers
Your Journey to Cloud-Native Begins with DevOps, Microservices, and Containers
 
Executive Briefing: The Why, What, and Where of Containers
Executive Briefing: The Why, What, and Where of ContainersExecutive Briefing: The Why, What, and Where of Containers
Executive Briefing: The Why, What, and Where of Containers
 
OGCE SC10
OGCE SC10OGCE SC10
OGCE SC10
 
{code} and containers
{code} and containers{code} and containers
{code} and containers
 
Microservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problemsMicroservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problems
 
Webinar: How and Why to Containerize Your Legacy Applications
Webinar: How and Why to Containerize Your Legacy ApplicationsWebinar: How and Why to Containerize Your Legacy Applications
Webinar: How and Why to Containerize Your Legacy Applications
 
The Last Frontier- Virtualization, Hybrid Management and the Cloud
The Last Frontier-  Virtualization, Hybrid Management and the CloudThe Last Frontier-  Virtualization, Hybrid Management and the Cloud
The Last Frontier- Virtualization, Hybrid Management and the Cloud
 
8base Hyperledger Miami Meetup Presentation
8base Hyperledger Miami Meetup Presentation8base Hyperledger Miami Meetup Presentation
8base Hyperledger Miami Meetup Presentation
 
8base Hyperledger Miami Meetup 20180719
8base Hyperledger Miami Meetup 201807198base Hyperledger Miami Meetup 20180719
8base Hyperledger Miami Meetup 20180719
 
SpringPeople - Introduction to Cloud Computing
SpringPeople - Introduction to Cloud ComputingSpringPeople - Introduction to Cloud Computing
SpringPeople - Introduction to Cloud Computing
 
UI Dev in Big data world using open source
UI Dev in Big data world using open sourceUI Dev in Big data world using open source
UI Dev in Big data world using open source
 
Technology insights: Decision Science Platform
Technology insights: Decision Science PlatformTechnology insights: Decision Science Platform
Technology insights: Decision Science Platform
 

Plus de Grace Jansen

Plus de Grace Jansen (20)

JPrime_JITServer.pptx
JPrime_JITServer.pptxJPrime_JITServer.pptx
JPrime_JITServer.pptx
 
SwissJUG_15_factor_app.pptx
SwissJUG_15_factor_app.pptxSwissJUG_15_factor_app.pptx
SwissJUG_15_factor_app.pptx
 
SwissJUG_Bringing the cloud back down to earth.pptx
SwissJUG_Bringing the cloud back down to earth.pptxSwissJUG_Bringing the cloud back down to earth.pptx
SwissJUG_Bringing the cloud back down to earth.pptx
 
ThroughTheLookingGlass_EffectiveObservability.pptx
ThroughTheLookingGlass_EffectiveObservability.pptxThroughTheLookingGlass_EffectiveObservability.pptx
ThroughTheLookingGlass_EffectiveObservability.pptx
 
PittsburgJUG_Cloud-Native Dev Tools: Bringing the cloud back to earth
PittsburgJUG_Cloud-Native Dev Tools: Bringing the cloud back to earthPittsburgJUG_Cloud-Native Dev Tools: Bringing the cloud back to earth
PittsburgJUG_Cloud-Native Dev Tools: Bringing the cloud back to earth
 
Javaland_JITServerTalk.pptx
Javaland_JITServerTalk.pptxJavaland_JITServerTalk.pptx
Javaland_JITServerTalk.pptx
 
JavaLand_To InstantOn and Beyond.pptx
JavaLand_To InstantOn and Beyond.pptxJavaLand_To InstantOn and Beyond.pptx
JavaLand_To InstantOn and Beyond.pptx
 
Jfokus_Bringing the cloud back down to earth.pptx
Jfokus_Bringing the cloud back down to earth.pptxJfokus_Bringing the cloud back down to earth.pptx
Jfokus_Bringing the cloud back down to earth.pptx
 
FooConf23_Bringing the cloud back down to earth.pptx
FooConf23_Bringing the cloud back down to earth.pptxFooConf23_Bringing the cloud back down to earth.pptx
FooConf23_Bringing the cloud back down to earth.pptx
 
JCON_15FactorWorkshop.pptx
JCON_15FactorWorkshop.pptxJCON_15FactorWorkshop.pptx
JCON_15FactorWorkshop.pptx
 
JCON_Adressing the transaction challenge in a cloud-native world.pptx
JCON_Adressing the transaction challenge in a cloud-native world.pptxJCON_Adressing the transaction challenge in a cloud-native world.pptx
JCON_Adressing the transaction challenge in a cloud-native world.pptx
 
JavaZone_Addressing the transaction challenge in a cloud-native world.pptx
JavaZone_Addressing the transaction challenge in a cloud-native world.pptxJavaZone_Addressing the transaction challenge in a cloud-native world.pptx
JavaZone_Addressing the transaction challenge in a cloud-native world.pptx
 
JavaZone_Mother Nature vs Java – the security face off.pptx
JavaZone_Mother Nature vs Java – the security face off.pptxJavaZone_Mother Nature vs Java – the security face off.pptx
JavaZone_Mother Nature vs Java – the security face off.pptx
 
Boost developer productivity with EE, MP and OL (Devoxx Ukraine 22).pptx
Boost developer productivity with EE, MP and OL (Devoxx Ukraine 22).pptxBoost developer productivity with EE, MP and OL (Devoxx Ukraine 22).pptx
Boost developer productivity with EE, MP and OL (Devoxx Ukraine 22).pptx
 
Addressing the transaction challenge in a cloud-native world Devoxx Ukraine 2022
Addressing the transaction challenge in a cloud-native world Devoxx Ukraine 2022Addressing the transaction challenge in a cloud-native world Devoxx Ukraine 2022
Addressing the transaction challenge in a cloud-native world Devoxx Ukraine 2022
 
JBCNConf_Addressing_The_Transaction_Challenge_LRA.pptx
JBCNConf_Addressing_The_Transaction_Challenge_LRA.pptxJBCNConf_Addressing_The_Transaction_Challenge_LRA.pptx
JBCNConf_Addressing_The_Transaction_Challenge_LRA.pptx
 
How to become a superhero without even leaving your desk!
How to become a superhero without even leaving your desk!How to become a superhero without even leaving your desk!
How to become a superhero without even leaving your desk!
 
Devoxx Ukraine - Going beyond the 12 factors
Devoxx Ukraine - Going beyond the 12 factorsDevoxx Ukraine - Going beyond the 12 factors
Devoxx Ukraine - Going beyond the 12 factors
 
BuildStuffConf Going beyond the 12 factors
BuildStuffConf Going beyond the 12 factorsBuildStuffConf Going beyond the 12 factors
BuildStuffConf Going beyond the 12 factors
 
JBCN_Testing_With_Containers
JBCN_Testing_With_ContainersJBCN_Testing_With_Containers
JBCN_Testing_With_Containers
 

Dernier

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 

Dernier (20)

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 

2022-Devnexus-StatefulMicroservices.pptx.pdf

  • 1. Exploring Stateful Microservices in the Cloud Native World Mary Grygleski & Grace Jansen @mgrygles April 2022 @gracejansen27
  • 2. Who is Grace Jansen? • Developer Advocate at IBM • Java, Cloud-Native, Reactive, MicroProfile, Open Source • A Biologist turned software engineer • Passionate about encouraging more WIT • Love traveling and trying new activities
  • 3. Who is Mary Grygleski? • Senior Developer Advocate at DataStax • Streaming, Event-Driven, NoSQL, Open Source • Java Champion • Over 25 years of software engineering experience that span a wide spectrum from product development to enterprise applications and beyond • Previously a Senior Developer Advocate at IBM • President of Chicago Java Users Group (CJUG) • Active church volunteer and religious education teacher
  • 6. Stateless Computing • State of the data does not get recorded between transactions A communication protocol that does not retain any session information • Scaling the system is easier • Recoverability from system failure is easier Architecture, design and implementation is simpler
  • 7. Realistically, we live in a Stateful world
  • 8. Stateful Computing • State of the data gets recorded at every step across all transactions A communication protocol that would retain all session information • Scaling the system is difficult • Recoverability from system failure involves a lot of efforts Architecture, design and implementation is complex
  • 9. The States of Data 3 fundamental state of data: ● Data at rest ● Data in motion ● Data in use
  • 10. The role of Microservices for the Data ● Microservices is a place where we “operate” on the data ● READ/WRITE: fetch from/place into the “data source” ● Data source: disk, in-memory, “cloud” ● Where I/O gets triggered to happen! ● Where transformation/remediation occur
  • 12. Client-Server Systems Stateful database systems on the server side Database-styled transactions 2-Phase Commit (2PC) Java Enterprise Java Beans – Stateful EJB (Session vs Entity Beans) Servlet – HTTPSession Client-side caching of server responses Cookie-based authentication Token-based authentication (JWT)
  • 15. Cloud Native Computing: An overarching approach ► Essentially an “extension” to Cloud Computing by addressing the true needs of enterprise-level distributed business application systems. ► What are the true needs? Netflix coined the term Cloud Native in the early 2010’s and essentially they wanted to leverage on the cloud to meet their goals for their systems to be: ► Highly available ► Scalable ► Performant
  • 16.
  • 17. The 12 Factor Application A methodology that was drafted by developers at Heroku. A set of guidelines or best practices for portable and resilient applications that are well suited to be in cloud environments. One of the factors indicates the need for self-contained services which are to be deployed as stateless processes. Microservices architecture (so far) is one that can satisfy such a requirement. It does not enforce the tools and libraries that the applications must use, but it provides the solid concepts that the applications must follow.
  • 18. The 12 Factor Application • VII. Port binding • Export services via port binding • VIII. Concurrency • Scale out via the process model • IX. Disposability • Maximize robustness with fast startup and graceful shutdown • X. Dev/prod parity • Keep development, staging, and production as similar as possible • XI. Logs • Treat logs as event streams • XII. Admin processes • Run admin/management tasks as one-off processes • I. Codebase • One codebase tracked in revision control, many deploys • II. Dependencies • Explicitly declare and isolate dependencies • III. Config • Store config in the environment • IV. Backing services • Treat backing services as attached resources • V. Build, release, run • Strictly separate build and run stages • VI. Processes • Execute the app as one or more stateless processes
  • 19. HOW to preserve state across session, transaction, and network boundaries?
  • 21. Leader Election (etcd) StatefulSets PersistentVolume Cookie/Session affinity (sticky session) Cloud Native Infrastructure: Containers/Kubernetes This Photo by Unknown Author is licensed under CC BY This Photo by Unknown Author is licensed under CC BY-SA-NC This Photo by Unknown Author is licensed under CC BY-SA This Photo by Unknown Author is licensed under CC BY-SA-NC
  • 22. Programming Design Pattern Saga Transactions spanning across multiple services Concept of compensation – no ”rollbacks” (forward strategy) 2 ways of coordination sagas: •Choreography •Orchestration Long-Running Action / Saga Interaction Pattern “Compensator” model Example Library implementing LRA: •MicroProfile LRA (1.0 – May 13, 2021)
  • 23. An example of a SAGA (choreography)
  • 25. Reactive Systems and the Reactive Manifesto Resilient Elastic Message-Driven Responsive
  • 27. Open Liberty session persistence labs Interactive Lab version: https://openliberty.io/guides/#persistence
  • 28. Apache Pulsar and Pulsar Functions Free-Tier Astra Cloud: https://astra.datastax.com ● Separation of Compute and Data Storage (Apache BookKeeper) ● Native from the start as a cloud-native provider ○ Multi-tenancy ○ Geo-replication
  • 30. Resources (Code samples, Design Patterns, Open Source Libraries) ● Code samples: ○ Open Liberty session persistence using JCache & Hazelcast https://openliberty.io/guides/sessions.html ○ A Stateful Open Liberty application in Kubernetes https://github.com/mgrygles/stateful-kube-demo Saga Design Pattern: https://microservices.io/patterns/data/saga.html MicroProfile LRA 1.0: https://download.eclipse.org/microprofile/microprofile-lra-1.0/microprofile-lra-spec- 1.0.html LRA Blog: MicroProfile Long Running Actions in Open Liberty ● Open Liberty: https://openliberty.io/ ○ Free tutorials/Guides: https://openliberty.io/guides ● MicroProfile: http://microprofile.io/ ● Jakarta EE: https://jakarta.ee/
  • 31. Resources (Cloud, Cloud-Native, DevOps) ● IBM Developer (all topics): https://developer.ibm.com ● IBM Developer (Cloud): https://developer.ibm.com/depmodels/cloud/ ● IBM Developer (Cloud DevOps): https://www.ibm.com/cloud/devops ● IBM Developer (Cloud Native): https://www.ibm.com/cloud/cloud-native/ ● IBM Developer (Saga Pattern): https://developer.ibm.com/articles/use-saga-to-solve-distributed-transaction-management-pr oblems-in-a-microservices-architecture/ ● Programming with Java on IBM Cloud (IBM Cloud Docs): https://cloud.ibm.com/docs/java?topic=cloud-native-overview ● Cloud Native Computing Foundation (CNCF): https://github.com/cncf/ ● The 12 Factor App (Cloud Native Best Practices): https://12factor.net/
  • 32. Resources (Apache Pulsar, Cassandra, AstraDB, Astra Streaming) Astra Streaming: https://www.datastax.com/products/astra-streaming Luna Streaming: https://www.datastax.com/products/luna-streaming Astra Cloud (free-tier Managed Cassandra on the Cloud): https://astra.datastax.com/ https://pulsar.apache.org/ https://bookkeeper.apache.org/ https://zookeeper.apache.org
  • 33. Managed Cassandra on the IBM Cloud https://www.ibm.com/cloud/databases-for-datastax
  • 34. Other Great Devnexus Sessions:
  • 35. Join our community meetups & free trainings IBM Expert TV: https://techtv.bemyapp.com/ IBM Developer on Meetup.com (includes all IBM Developer meetup groups in cities all over the world!) https://www.meetup.com/pro/ibmdeveloper/ DataStax YouTube Channel: https://www.youtube.com/c/DataStax Highly recommended also: Chicago Java Users Group (CJUG) https://www.meetup.com/ChicagoJUG/
  • 36. Follow Mary’s Twitch Stream (Different topics: Java, Open Source, Distributed Messaging, Event-Streaming, Cloud, DevOps, etc) Wednesday at 2pm-US/Central https://twitch.tv/mgrygles
  • 37. Join Pulsar at the ‘hood https://www.meetup.com/pro/apache-pulsar-neighborhood https://pulsar-neighborhood.github.io/
  • 38. Join Mary on Discord https://discord.gg/RMU4Juw Thank You! @mgrygles https://linkedin.com/in/mary-grygleski https://github.com/mgrygles https://dev.to/mgrygles @gracejansen27 https://linkedin.com/in/grace-jansen https://github.com/GraceJanse https://developer.ibm.com/profiles/grace.jansen1/