SlideShare una empresa de Scribd logo
1 de 56
Essential API Facade Patterns
Episode 2 – Session Management




Santanu Dey                       Apigee
@Santanu_Dey                     @apigee
groups.google.com/group/api-craft
slideshare.net/apigee
youtube.com/apigee
@Santanu_Dey
 Santanu Dey
Webcast Series: API Facade Patterns


Episode 1
Composition

Episode 2
Session Management

Episode 3
One Phase to Two Phase Conversion

Episode 4
Synchronous to Asynchronous
Episode 2 : Session Management




Problem
Solution
Benefits
Considerations
Problem




Use Session Management to

enable API teams and app developers to implement
and improve their API designs and apps
Session Management

Managing the state of dynamically created resources
(per client) through a series of client-server interactions
Services are best kept stateless
But . . . sometimes stateful services are really needed
Example: shopping cart
Stateful interaction requires session




                              Add /                   Check out
Create cart                                                                        Track order
                              remove
              Shopping Cart   items
                                       Cart updated               Order received
                 Created
Example: room booking
Example: job application
Even OAuth requires a session
Session management helps in maintaining client
context (on the server)
State management and session management
are not the same
Session Management

is one of the ways of managing client state
In the context of APIs

   how to design Session Management?

   how to implement Session Management?
Application Servers solve this issue for the Web by
managing client sessions
Application servers solved this problem for the Web




                                            Backend
  Browser              App Server
                                             Server

  Users
Application servers solved this problem for the Web

                                   No stored client context
Each request must contain all      on the transaction server
      state information




                                                               Backend
    Browser                     App Server
                                                                Server

  Users

                                 Order Processing Server
                                 • Server is stateless to be scalable
                                 • Not designed to handle client specific
                                   resource state
Application servers solved this problem for the Web


              Each request                      No stored client
             must contain all                    context on the
            state information                  transaction server




                                                                 Backend
  Browser                       App Server
                                                                  Server

 Users                          Web               Order Processing Server
                                Application       • Server is stateless to be
                                Manages user        scalable
                                sessions          • Not designed to handle
                                                    client specific resource
                                                    state
Application servers solved this problem for the Web
     Each request must                No stored client
      contain all state                context on the
        information                  transaction server




                                                          Backend
  Browser                  App Server
                                                           Server
 Users                    Web          Order Processing Server
         Very close to    Application  • Server is stateless to be
         Hypermedia       Manages user   scalable
           Interface      sessions     • Not designed to handle
                                         client specific resource
                                         state
But, we need an App!
Solution
If application servers solved this problem for the Web
    How do we reuse this capability when exposing APIs?

      Each request must                No stored client
       contain all state                context on the
         information                  transaction server




                                                           Backend
   Browser                  App Server
                                                            Server

  Users                    Web          Order Processing Server
          Very close to    Application  • Server is stateless to be
          Hypermedia       Manages user   scalable
            Interface      sessions     • Not designed to handle
                                          client specific resource
                                          state
In mobile applications parlance managing client state
on the device is expensive

   Requires more local processing
   Requires more local storage
   Requires more date exchange over the network
Managing client state on the back-end server is
expensive too.
Stateful interaction with RESTful APIs



                       API Façade


                                                Backend
                                                 Server



App relies on
REST
Example of the API Façade


                             API Façade




                           API
                                       Existing     Backend
                        Exposure &
                                     Capabilities    Server
                          Mgmt

App relies on REST
Stateful interaction with RESTful APIs



                                 Totally Stateless Interface


                         API Façade


                                                               Backend
                                                                Server



App relies on REST
Stateful interaction with RESTful APIs

       Provide HATEOAS                  Totally stateless Interface


                           API Façade


                                                                      Backend
                                                                       Server


                         Holds transient state
App relies on REST
                         information & provides the
                         hyperlinks for the state
                         transition
View a product

Returns the details of a product along with hypermedia to allow
interaction with the product resource.
GET http://yourhost/products/sku/098430?user=123&cart=2235




{
    "Product":{
      "item-name":"MTune MP3 Player",
      "description":"2GB MP3 Player",
      "unit-price":"34.56",
      "sku":"098430",
      "link":{
         "@attributes":{
           "url":"/cart/id/2235/addProduct/sku/098430?user=123"
         }
      }
    }
}
Add a product
Adds a Product to an existing shopping cart & returns the cart.
POST http://yourhost/cart/2235/addProduct/sku/098430?user=123


    {
        "Cart":{
          "id":"2235",
          "Name":"Christmas Shopper",
          "link":{
             "@attributes":{
                "url":"/cart/id/2235"
             }
          },
          "items":{
             "item":{
                "item-name":"MTune 2GB MP3 Player",
                "description":"MTune, MP3 player",
                "unit-price":"34.56",
                "quantity":"1"
             }
          }
        }
    }
State of the cart helps represent the shopping session
Benefits
Manages session state as part of state transition of
the resource


                      API Façade

                                                 Backend
                                                  Server
Warning! UML Ahead
API Façade provides access to transient resources
through RESTful APIs
App Developers consume REST more easily



App Developer

   Doesn’t have to control the state
   Doesn’t have to maintain the entire state information
   Doesn’t have to resubmit each time
   Less programming overhead
The API Façade addresses scalability while managing
transient resources


                    API Façade

                                              Backend
                                               Server
The API Façade addresses replay attack, session
hijacking concerns


                         API Façade

                                                  Backend
                                                   Server

        Malicious user
Programmable
Can capture analytics around session usage
Other Considerations
When should we really think about Session
Management?
If it is too much overhead to send back the entire
context data each time
Information associated with Session or “transit
resource” should be minimal
Session should be expired within a short time (security
concern)
Questions?
THANK YOU
Subscribe to API webcasts at:
youtube.com/apigee



                                 Apigee
                                @apigee
THANK YOU
Questions and ideas to:
groups.google.com/group/api-craft



                                     Apigee
                                    @apigee
THANK YOU
Contact me at:

@Santanu_Dey
sdey@apigee.com




                   Apigee
                  @apigee

Más contenido relacionado

La actualidad más candente

Cloud Native Application
Cloud Native ApplicationCloud Native Application
Cloud Native ApplicationVMUG IT
 
AWS January 2016 Webinar Series - Introduction to Docker on AWS
AWS January 2016 Webinar Series - Introduction to Docker on AWSAWS January 2016 Webinar Series - Introduction to Docker on AWS
AWS January 2016 Webinar Series - Introduction to Docker on AWSAmazon Web Services
 
Microservices
MicroservicesMicroservices
MicroservicesSmartBear
 
Modernize your Microsoft Applications on AWS
Modernize your Microsoft Applications on AWSModernize your Microsoft Applications on AWS
Modernize your Microsoft Applications on AWSAmazon Web Services
 
Building a DevOps organization
Building a DevOps organizationBuilding a DevOps organization
Building a DevOps organizationZinnov
 
Monoliths and Microservices
Monoliths and Microservices Monoliths and Microservices
Monoliths and Microservices Bozhidar Bozhanov
 
Authorization Enterprise Design Pattern
Authorization Enterprise Design PatternAuthorization Enterprise Design Pattern
Authorization Enterprise Design PatternNick Bogden
 
Data integration with Apache Kafka
Data integration with Apache KafkaData integration with Apache Kafka
Data integration with Apache Kafkaconfluent
 
The Need of Cloud-Native Application
The Need of Cloud-Native ApplicationThe Need of Cloud-Native Application
The Need of Cloud-Native ApplicationEmiliano Pecis
 
DoK Talks #91- Leveraging Druid Operator to manage Apache Druid on Kubernetes
DoK Talks #91- Leveraging Druid Operator to manage Apache Druid on KubernetesDoK Talks #91- Leveraging Druid Operator to manage Apache Druid on Kubernetes
DoK Talks #91- Leveraging Druid Operator to manage Apache Druid on KubernetesDoKC
 
Introduction To Microservices
Introduction To MicroservicesIntroduction To Microservices
Introduction To MicroservicesLalit Kale
 
Microservices architecture overview v2
Microservices architecture overview v2Microservices architecture overview v2
Microservices architecture overview v2Dmitry Skaredov
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services ArchitectureAraf Karsh Hamid
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architectureThe Software House
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservicesAnil Allewar
 
DevSecCon London 2019: Workshop: Cloud Agnostic Security Testing with Scout S...
DevSecCon London 2019: Workshop: Cloud Agnostic Security Testing with Scout S...DevSecCon London 2019: Workshop: Cloud Agnostic Security Testing with Scout S...
DevSecCon London 2019: Workshop: Cloud Agnostic Security Testing with Scout S...DevSecCon
 

La actualidad más candente (20)

Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Cloud Native Application
Cloud Native ApplicationCloud Native Application
Cloud Native Application
 
AWS January 2016 Webinar Series - Introduction to Docker on AWS
AWS January 2016 Webinar Series - Introduction to Docker on AWSAWS January 2016 Webinar Series - Introduction to Docker on AWS
AWS January 2016 Webinar Series - Introduction to Docker on AWS
 
Microservices
MicroservicesMicroservices
Microservices
 
Modernize your Microsoft Applications on AWS
Modernize your Microsoft Applications on AWSModernize your Microsoft Applications on AWS
Modernize your Microsoft Applications on AWS
 
Building a DevOps organization
Building a DevOps organizationBuilding a DevOps organization
Building a DevOps organization
 
Monoliths and Microservices
Monoliths and Microservices Monoliths and Microservices
Monoliths and Microservices
 
Authorization Enterprise Design Pattern
Authorization Enterprise Design PatternAuthorization Enterprise Design Pattern
Authorization Enterprise Design Pattern
 
Data integration with Apache Kafka
Data integration with Apache KafkaData integration with Apache Kafka
Data integration with Apache Kafka
 
The Need of Cloud-Native Application
The Need of Cloud-Native ApplicationThe Need of Cloud-Native Application
The Need of Cloud-Native Application
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
Ansible
AnsibleAnsible
Ansible
 
DoK Talks #91- Leveraging Druid Operator to manage Apache Druid on Kubernetes
DoK Talks #91- Leveraging Druid Operator to manage Apache Druid on KubernetesDoK Talks #91- Leveraging Druid Operator to manage Apache Druid on Kubernetes
DoK Talks #91- Leveraging Druid Operator to manage Apache Druid on Kubernetes
 
Introduction To Microservices
Introduction To MicroservicesIntroduction To Microservices
Introduction To Microservices
 
Microservices architecture overview v2
Microservices architecture overview v2Microservices architecture overview v2
Microservices architecture overview v2
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services Architecture
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architecture
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
Patterns of resilience
Patterns of resiliencePatterns of resilience
Patterns of resilience
 
DevSecCon London 2019: Workshop: Cloud Agnostic Security Testing with Scout S...
DevSecCon London 2019: Workshop: Cloud Agnostic Security Testing with Scout S...DevSecCon London 2019: Workshop: Cloud Agnostic Security Testing with Scout S...
DevSecCon London 2019: Workshop: Cloud Agnostic Security Testing with Scout S...
 

Destacado

Essential API Facade Patterns - Composition (Episode 1)
Essential API Facade Patterns - Composition (Episode 1)Essential API Facade Patterns - Composition (Episode 1)
Essential API Facade Patterns - Composition (Episode 1)Apigee | Google Cloud
 
Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)
Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)
Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)Apigee | Google Cloud
 
The API Facade Pattern: Common Patterns - Episode 2
The API Facade Pattern: Common Patterns - Episode 2The API Facade Pattern: Common Patterns - Episode 2
The API Facade Pattern: Common Patterns - Episode 2Apigee | Google Cloud
 
The API Facade Pattern: Overview - Episode 1
The API Facade Pattern: Overview - Episode 1The API Facade Pattern: Overview - Episode 1
The API Facade Pattern: Overview - Episode 1Apigee | Google Cloud
 
SCWCD : Session management : CHAP : 6
SCWCD : Session management : CHAP : 6SCWCD : Session management : CHAP : 6
SCWCD : Session management : CHAP : 6Ben Abdallah Helmi
 
Visbility at the Edge - Deep Insights from Your API
 Visbility at the Edge - Deep Insights from Your API Visbility at the Edge - Deep Insights from Your API
Visbility at the Edge - Deep Insights from Your APIApigee | Google Cloud
 
The Anatomy of Apps - How iPhone, Android & Facebook Apps Consume APIs
The Anatomy of Apps - How iPhone, Android & Facebook Apps Consume APIsThe Anatomy of Apps - How iPhone, Android & Facebook Apps Consume APIs
The Anatomy of Apps - How iPhone, Android & Facebook Apps Consume APIsApigee | Google Cloud
 
Skeuomorphs, Databases, and Mobile Performance
Skeuomorphs, Databases, and Mobile PerformanceSkeuomorphs, Databases, and Mobile Performance
Skeuomorphs, Databases, and Mobile PerformanceApigee | Google Cloud
 
HTML5: The Apps, the Frameworks, the Controversy
HTML5: The Apps, the Frameworks, the Controversy HTML5: The Apps, the Frameworks, the Controversy
HTML5: The Apps, the Frameworks, the Controversy Apigee | Google Cloud
 
The API Facade Pattern: People - Episode 4
The API Facade Pattern: People - Episode 4The API Facade Pattern: People - Episode 4
The API Facade Pattern: People - Episode 4Apigee | Google Cloud
 
Crafting APIs for Mobile Apps - Everything You Need to Know
Crafting APIs for Mobile Apps - Everything You Need to KnowCrafting APIs for Mobile Apps - Everything You Need to Know
Crafting APIs for Mobile Apps - Everything You Need to KnowApigee | Google Cloud
 
Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...
Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...
Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...Apigee | Google Cloud
 
Mensen en bomen ‘anders’ leren zien (Aswoensdag 2017)
Mensen en bomen ‘anders’ leren zien (Aswoensdag 2017)Mensen en bomen ‘anders’ leren zien (Aswoensdag 2017)
Mensen en bomen ‘anders’ leren zien (Aswoensdag 2017)Ten Bos
 
Building your first Native iOs App with an API Backend
Building your first Native iOs App with an API BackendBuilding your first Native iOs App with an API Backend
Building your first Native iOs App with an API BackendApigee | Google Cloud
 
Driving Digital Success: Three ROI Criteria for Competitive Advantage
Driving Digital Success:  Three ROI Criteria for Competitive Advantage Driving Digital Success:  Three ROI Criteria for Competitive Advantage
Driving Digital Success: Three ROI Criteria for Competitive Advantage Apigee | Google Cloud
 
The New 3-Tier Architecture: HTML5, Proxies, and APIs
The New 3-Tier Architecture: HTML5, Proxies, and APIsThe New 3-Tier Architecture: HTML5, Proxies, and APIs
The New 3-Tier Architecture: HTML5, Proxies, and APIsApigee | Google Cloud
 
[@IndeedEng] Boxcar: A self-balancing distributed services protocol
[@IndeedEng] Boxcar: A self-balancing distributed services protocol [@IndeedEng] Boxcar: A self-balancing distributed services protocol
[@IndeedEng] Boxcar: A self-balancing distributed services protocol indeedeng
 

Destacado (20)

Essential API Facade Patterns - Composition (Episode 1)
Essential API Facade Patterns - Composition (Episode 1)Essential API Facade Patterns - Composition (Episode 1)
Essential API Facade Patterns - Composition (Episode 1)
 
Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)
Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)
Essential API Facade Patterns: One Phase to Two Phase Conversion (Episode 3)
 
The API Facade Pattern: Common Patterns - Episode 2
The API Facade Pattern: Common Patterns - Episode 2The API Facade Pattern: Common Patterns - Episode 2
The API Facade Pattern: Common Patterns - Episode 2
 
The API Facade Pattern: Overview - Episode 1
The API Facade Pattern: Overview - Episode 1The API Facade Pattern: Overview - Episode 1
The API Facade Pattern: Overview - Episode 1
 
Lecture 7
Lecture 7Lecture 7
Lecture 7
 
API Façade Pattern
API Façade PatternAPI Façade Pattern
API Façade Pattern
 
SCWCD : Session management : CHAP : 6
SCWCD : Session management : CHAP : 6SCWCD : Session management : CHAP : 6
SCWCD : Session management : CHAP : 6
 
Visbility at the Edge - Deep Insights from Your API
 Visbility at the Edge - Deep Insights from Your API Visbility at the Edge - Deep Insights from Your API
Visbility at the Edge - Deep Insights from Your API
 
The Anatomy of Apps - How iPhone, Android & Facebook Apps Consume APIs
The Anatomy of Apps - How iPhone, Android & Facebook Apps Consume APIsThe Anatomy of Apps - How iPhone, Android & Facebook Apps Consume APIs
The Anatomy of Apps - How iPhone, Android & Facebook Apps Consume APIs
 
Skeuomorphs, Databases, and Mobile Performance
Skeuomorphs, Databases, and Mobile PerformanceSkeuomorphs, Databases, and Mobile Performance
Skeuomorphs, Databases, and Mobile Performance
 
HTML5: The Apps, the Frameworks, the Controversy
HTML5: The Apps, the Frameworks, the Controversy HTML5: The Apps, the Frameworks, the Controversy
HTML5: The Apps, the Frameworks, the Controversy
 
The API Facade Pattern: People - Episode 4
The API Facade Pattern: People - Episode 4The API Facade Pattern: People - Episode 4
The API Facade Pattern: People - Episode 4
 
Crafting APIs for Mobile Apps - Everything You Need to Know
Crafting APIs for Mobile Apps - Everything You Need to KnowCrafting APIs for Mobile Apps - Everything You Need to Know
Crafting APIs for Mobile Apps - Everything You Need to Know
 
Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...
Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...
Essential API Facade Patterns: Synchronous to Asynchronous Conversion (Episod...
 
Mensen en bomen ‘anders’ leren zien (Aswoensdag 2017)
Mensen en bomen ‘anders’ leren zien (Aswoensdag 2017)Mensen en bomen ‘anders’ leren zien (Aswoensdag 2017)
Mensen en bomen ‘anders’ leren zien (Aswoensdag 2017)
 
Building your first Native iOs App with an API Backend
Building your first Native iOs App with an API BackendBuilding your first Native iOs App with an API Backend
Building your first Native iOs App with an API Backend
 
Driving Digital Success: Three ROI Criteria for Competitive Advantage
Driving Digital Success:  Three ROI Criteria for Competitive Advantage Driving Digital Success:  Three ROI Criteria for Competitive Advantage
Driving Digital Success: Three ROI Criteria for Competitive Advantage
 
The New 3-Tier Architecture: HTML5, Proxies, and APIs
The New 3-Tier Architecture: HTML5, Proxies, and APIsThe New 3-Tier Architecture: HTML5, Proxies, and APIs
The New 3-Tier Architecture: HTML5, Proxies, and APIs
 
Persistent memory
Persistent memoryPersistent memory
Persistent memory
 
[@IndeedEng] Boxcar: A self-balancing distributed services protocol
[@IndeedEng] Boxcar: A self-balancing distributed services protocol [@IndeedEng] Boxcar: A self-balancing distributed services protocol
[@IndeedEng] Boxcar: A self-balancing distributed services protocol
 

Similar a Essential API Facade Patterns: Session Management (Episode 2)

Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...
Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...
Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...Joonas Lehtinen
 
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joo...
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joo...Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joo...
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joo...jaxconf
 
vFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS AppsvFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS AppsVMware vFabric
 
vFabric for i ISVs and MSPs
vFabric for i ISVs and MSPsvFabric for i ISVs and MSPs
vFabric for i ISVs and MSPsVMware vFabric
 
App Engine overview (Android meetup 06-10)
App Engine overview (Android meetup 06-10)App Engine overview (Android meetup 06-10)
App Engine overview (Android meetup 06-10)jasonacooper
 
Introducing the new SharePoint 2013 app model
Introducing the new SharePoint 2013 app modelIntroducing the new SharePoint 2013 app model
Introducing the new SharePoint 2013 app modelJeremy Thake
 
Sp2010 high availlability
Sp2010 high availlabilitySp2010 high availlability
Sp2010 high availlabilitySamuel Zürcher
 
13h00 p duff-building-applications-with-aws-final
13h00   p duff-building-applications-with-aws-final13h00   p duff-building-applications-with-aws-final
13h00 p duff-building-applications-with-aws-finalLuiz Gustavo Santos
 
RUCUG: 6. Fabian Kienle - NetScaler and Branch Repeater for Hyper-V
RUCUG: 6. Fabian Kienle - NetScaler and Branch Repeater for Hyper-VRUCUG: 6. Fabian Kienle - NetScaler and Branch Repeater for Hyper-V
RUCUG: 6. Fabian Kienle - NetScaler and Branch Repeater for Hyper-VDenis Gundarev
 
Oracle Application Management Suite
Oracle Application Management SuiteOracle Application Management Suite
Oracle Application Management SuiteOracleVolutionSeries
 
Citrix XenApp 6.5 Performance - How To Ensure a Great End User Experience Bef...
Citrix XenApp 6.5 Performance - How To Ensure a Great End User Experience Bef...Citrix XenApp 6.5 Performance - How To Ensure a Great End User Experience Bef...
Citrix XenApp 6.5 Performance - How To Ensure a Great End User Experience Bef...eG Innovations
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
Sviluppare App per Office 2013 e SharePoint 2013
Sviluppare App per Office 2013 e SharePoint 2013Sviluppare App per Office 2013 e SharePoint 2013
Sviluppare App per Office 2013 e SharePoint 2013Giuseppe Marchi
 
Usergrid Overview
Usergrid OverviewUsergrid Overview
Usergrid Overviewusergrid
 
Creating an Ecosystem Platform with Vertical PaaS
Creating an Ecosystem Platform with Vertical PaaSCreating an Ecosystem Platform with Vertical PaaS
Creating an Ecosystem Platform with Vertical PaaSWSO2
 
Windows Server 2008 R2 Overview
Windows Server 2008 R2 OverviewWindows Server 2008 R2 Overview
Windows Server 2008 R2 OverviewSteven Wilder
 

Similar a Essential API Facade Patterns: Session Management (Episode 2) (20)

Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...
Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...
Vaadin - Rich Web Applications in Server-side Java without Plug-ins or JavaSc...
 
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joo...
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joo...Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joo...
Vaadin, Rich Web Apps in Server-Side Java without Plug-ins or JavaScript: Joo...
 
vFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS AppsvFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS Apps
 
vFabric for i ISVs and MSPs
vFabric for i ISVs and MSPsvFabric for i ISVs and MSPs
vFabric for i ISVs and MSPs
 
Apps for SharePoint
Apps for SharePointApps for SharePoint
Apps for SharePoint
 
App Engine overview (Android meetup 06-10)
App Engine overview (Android meetup 06-10)App Engine overview (Android meetup 06-10)
App Engine overview (Android meetup 06-10)
 
Introducing the new SharePoint 2013 app model
Introducing the new SharePoint 2013 app modelIntroducing the new SharePoint 2013 app model
Introducing the new SharePoint 2013 app model
 
Ideas for addictive series 40 web apps
Ideas for addictive series 40 web appsIdeas for addictive series 40 web apps
Ideas for addictive series 40 web apps
 
Smartsup
SmartsupSmartsup
Smartsup
 
Sp2010 high availlability
Sp2010 high availlabilitySp2010 high availlability
Sp2010 high availlability
 
13h00 p duff-building-applications-with-aws-final
13h00   p duff-building-applications-with-aws-final13h00   p duff-building-applications-with-aws-final
13h00 p duff-building-applications-with-aws-final
 
Building Applications with AWS
Building Applications with AWSBuilding Applications with AWS
Building Applications with AWS
 
RUCUG: 6. Fabian Kienle - NetScaler and Branch Repeater for Hyper-V
RUCUG: 6. Fabian Kienle - NetScaler and Branch Repeater for Hyper-VRUCUG: 6. Fabian Kienle - NetScaler and Branch Repeater for Hyper-V
RUCUG: 6. Fabian Kienle - NetScaler and Branch Repeater for Hyper-V
 
Oracle Application Management Suite
Oracle Application Management SuiteOracle Application Management Suite
Oracle Application Management Suite
 
Citrix XenApp 6.5 Performance - How To Ensure a Great End User Experience Bef...
Citrix XenApp 6.5 Performance - How To Ensure a Great End User Experience Bef...Citrix XenApp 6.5 Performance - How To Ensure a Great End User Experience Bef...
Citrix XenApp 6.5 Performance - How To Ensure a Great End User Experience Bef...
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Sviluppare App per Office 2013 e SharePoint 2013
Sviluppare App per Office 2013 e SharePoint 2013Sviluppare App per Office 2013 e SharePoint 2013
Sviluppare App per Office 2013 e SharePoint 2013
 
Usergrid Overview
Usergrid OverviewUsergrid Overview
Usergrid Overview
 
Creating an Ecosystem Platform with Vertical PaaS
Creating an Ecosystem Platform with Vertical PaaSCreating an Ecosystem Platform with Vertical PaaS
Creating an Ecosystem Platform with Vertical PaaS
 
Windows Server 2008 R2 Overview
Windows Server 2008 R2 OverviewWindows Server 2008 R2 Overview
Windows Server 2008 R2 Overview
 

Más de Apigee | Google Cloud

Monetization: Unlock More Value from Your APIs
Monetization: Unlock More Value from Your APIs Monetization: Unlock More Value from Your APIs
Monetization: Unlock More Value from Your APIs Apigee | Google Cloud
 
AccuWeather: Recasting API Experiences in a Developer-First World
AccuWeather: Recasting API Experiences in a Developer-First WorldAccuWeather: Recasting API Experiences in a Developer-First World
AccuWeather: Recasting API Experiences in a Developer-First WorldApigee | Google Cloud
 
Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?Apigee | Google Cloud
 
The Four Transformative Forces of the API Management Market
The Four Transformative Forces of the API Management MarketThe Four Transformative Forces of the API Management Market
The Four Transformative Forces of the API Management MarketApigee | Google Cloud
 
Managing the Complexity of Microservices Deployments
Managing the Complexity of Microservices DeploymentsManaging the Complexity of Microservices Deployments
Managing the Complexity of Microservices DeploymentsApigee | Google Cloud
 
Microservices Done Right: Key Ingredients for Microservices Success
Microservices Done Right: Key Ingredients for Microservices SuccessMicroservices Done Right: Key Ingredients for Microservices Success
Microservices Done Right: Key Ingredients for Microservices SuccessApigee | Google Cloud
 
Adapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet KapoorAdapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet KapoorApigee | Google Cloud
 
Adapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg BrailAdapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg BrailApigee | Google Cloud
 
Adapt or Die: Keynote with Anant Jhingran
Adapt or Die: Keynote with Anant JhingranAdapt or Die: Keynote with Anant Jhingran
Adapt or Die: Keynote with Anant JhingranApigee | Google Cloud
 
London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Closing Keynote — Adapt Now!London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Closing Keynote — Adapt Now!Apigee | Google Cloud
 

Más de Apigee | Google Cloud (20)

How Secure Are Your APIs?
How Secure Are Your APIs?How Secure Are Your APIs?
How Secure Are Your APIs?
 
Magazine Luiza at a glance (1)
Magazine Luiza at a glance (1)Magazine Luiza at a glance (1)
Magazine Luiza at a glance (1)
 
Monetization: Unlock More Value from Your APIs
Monetization: Unlock More Value from Your APIs Monetization: Unlock More Value from Your APIs
Monetization: Unlock More Value from Your APIs
 
Apigee Demo: API Platform Overview
Apigee Demo: API Platform OverviewApigee Demo: API Platform Overview
Apigee Demo: API Platform Overview
 
Ticketmaster at a glance
Ticketmaster at a glanceTicketmaster at a glance
Ticketmaster at a glance
 
AccuWeather: Recasting API Experiences in a Developer-First World
AccuWeather: Recasting API Experiences in a Developer-First WorldAccuWeather: Recasting API Experiences in a Developer-First World
AccuWeather: Recasting API Experiences in a Developer-First World
 
Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?
 
Apigee Product Roadmap Part 2
Apigee Product Roadmap Part 2Apigee Product Roadmap Part 2
Apigee Product Roadmap Part 2
 
The Four Transformative Forces of the API Management Market
The Four Transformative Forces of the API Management MarketThe Four Transformative Forces of the API Management Market
The Four Transformative Forces of the API Management Market
 
Walgreens at a glance
Walgreens at a glanceWalgreens at a glance
Walgreens at a glance
 
Apigee Edge: Intro to Microgateway
Apigee Edge: Intro to MicrogatewayApigee Edge: Intro to Microgateway
Apigee Edge: Intro to Microgateway
 
Managing the Complexity of Microservices Deployments
Managing the Complexity of Microservices DeploymentsManaging the Complexity of Microservices Deployments
Managing the Complexity of Microservices Deployments
 
Pitney Bowes at a glance
Pitney Bowes at a glancePitney Bowes at a glance
Pitney Bowes at a glance
 
Microservices Done Right: Key Ingredients for Microservices Success
Microservices Done Right: Key Ingredients for Microservices SuccessMicroservices Done Right: Key Ingredients for Microservices Success
Microservices Done Right: Key Ingredients for Microservices Success
 
Adapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet KapoorAdapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet Kapoor
 
Adapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg BrailAdapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg Brail
 
Adapt or Die: Keynote with Anant Jhingran
Adapt or Die: Keynote with Anant JhingranAdapt or Die: Keynote with Anant Jhingran
Adapt or Die: Keynote with Anant Jhingran
 
London Adapt or Die: Opening Keynot
London Adapt or Die: Opening KeynotLondon Adapt or Die: Opening Keynot
London Adapt or Die: Opening Keynot
 
London Adapt or Die: Lunch keynote
London Adapt or Die: Lunch keynoteLondon Adapt or Die: Lunch keynote
London Adapt or Die: Lunch keynote
 
London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Closing Keynote — Adapt Now!London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Closing Keynote — Adapt Now!
 

Último

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Último (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Essential API Facade Patterns: Session Management (Episode 2)

  • 1. Essential API Facade Patterns Episode 2 – Session Management Santanu Dey Apigee @Santanu_Dey @apigee
  • 6. Webcast Series: API Facade Patterns Episode 1 Composition Episode 2 Session Management Episode 3 One Phase to Two Phase Conversion Episode 4 Synchronous to Asynchronous
  • 7. Episode 2 : Session Management Problem Solution Benefits Considerations
  • 8. Problem Use Session Management to enable API teams and app developers to implement and improve their API designs and apps
  • 9. Session Management Managing the state of dynamically created resources (per client) through a series of client-server interactions
  • 10. Services are best kept stateless
  • 11. But . . . sometimes stateful services are really needed
  • 13. Stateful interaction requires session Add / Check out Create cart Track order remove Shopping Cart items Cart updated Order received Created
  • 16. Even OAuth requires a session
  • 17. Session management helps in maintaining client context (on the server)
  • 18. State management and session management are not the same
  • 19. Session Management is one of the ways of managing client state
  • 20. In the context of APIs how to design Session Management? how to implement Session Management?
  • 21. Application Servers solve this issue for the Web by managing client sessions
  • 22. Application servers solved this problem for the Web Backend Browser App Server Server Users
  • 23. Application servers solved this problem for the Web No stored client context Each request must contain all on the transaction server state information Backend Browser App Server Server Users Order Processing Server • Server is stateless to be scalable • Not designed to handle client specific resource state
  • 24. Application servers solved this problem for the Web Each request No stored client must contain all context on the state information transaction server Backend Browser App Server Server Users Web Order Processing Server Application • Server is stateless to be Manages user scalable sessions • Not designed to handle client specific resource state
  • 25. Application servers solved this problem for the Web Each request must No stored client contain all state context on the information transaction server Backend Browser App Server Server Users Web Order Processing Server Very close to Application • Server is stateless to be Hypermedia Manages user scalable Interface sessions • Not designed to handle client specific resource state
  • 26. But, we need an App!
  • 28. If application servers solved this problem for the Web How do we reuse this capability when exposing APIs? Each request must No stored client contain all state context on the information transaction server Backend Browser App Server Server Users Web Order Processing Server Very close to Application • Server is stateless to be Hypermedia Manages user scalable Interface sessions • Not designed to handle client specific resource state
  • 29. In mobile applications parlance managing client state on the device is expensive Requires more local processing Requires more local storage Requires more date exchange over the network
  • 30. Managing client state on the back-end server is expensive too.
  • 31. Stateful interaction with RESTful APIs API Façade Backend Server App relies on REST
  • 32. Example of the API Façade API Façade API Existing Backend Exposure & Capabilities Server Mgmt App relies on REST
  • 33. Stateful interaction with RESTful APIs Totally Stateless Interface API Façade Backend Server App relies on REST
  • 34. Stateful interaction with RESTful APIs Provide HATEOAS Totally stateless Interface API Façade Backend Server Holds transient state App relies on REST information & provides the hyperlinks for the state transition
  • 35. View a product Returns the details of a product along with hypermedia to allow interaction with the product resource. GET http://yourhost/products/sku/098430?user=123&cart=2235 { "Product":{ "item-name":"MTune MP3 Player", "description":"2GB MP3 Player", "unit-price":"34.56", "sku":"098430", "link":{ "@attributes":{ "url":"/cart/id/2235/addProduct/sku/098430?user=123" } } } }
  • 36. Add a product Adds a Product to an existing shopping cart & returns the cart. POST http://yourhost/cart/2235/addProduct/sku/098430?user=123 { "Cart":{ "id":"2235", "Name":"Christmas Shopper", "link":{ "@attributes":{ "url":"/cart/id/2235" } }, "items":{ "item":{ "item-name":"MTune 2GB MP3 Player", "description":"MTune, MP3 player", "unit-price":"34.56", "quantity":"1" } } } }
  • 37. State of the cart helps represent the shopping session
  • 39. Manages session state as part of state transition of the resource API Façade Backend Server
  • 41.
  • 42. API Façade provides access to transient resources through RESTful APIs
  • 43. App Developers consume REST more easily App Developer Doesn’t have to control the state Doesn’t have to maintain the entire state information Doesn’t have to resubmit each time Less programming overhead
  • 44. The API Façade addresses scalability while managing transient resources API Façade Backend Server
  • 45. The API Façade addresses replay attack, session hijacking concerns API Façade Backend Server Malicious user
  • 47. Can capture analytics around session usage
  • 49. When should we really think about Session Management?
  • 50. If it is too much overhead to send back the entire context data each time
  • 51. Information associated with Session or “transit resource” should be minimal
  • 52. Session should be expired within a short time (security concern)
  • 54. THANK YOU Subscribe to API webcasts at: youtube.com/apigee Apigee @apigee
  • 55. THANK YOU Questions and ideas to: groups.google.com/group/api-craft Apigee @apigee
  • 56. THANK YOU Contact me at: @Santanu_Dey sdey@apigee.com Apigee @apigee

Notas del editor

  1. Design related- How do I design the right kind of interfaces on the server side?When should I really rely on Session Management, notwithstanding the How about authenticated sessions?How long the session should live?How much context data can be stored?Implementation relatedHow do I implement thisServer / Client In case of APIs what are the other considerations?How about persistence of session?How about scalability?
  2. Back-endsProduct catalogueInventory ManagementPricing engine, Promotion / Tax rulesERPthe Backend stack here would beshared by multiple channels– Online ecommerce could be one of them. Hence The backend is not dedicated for the eCommerce and the problems associated with allowing such transaction flow through.
  3. The backend is not designed for Storing client contextor managing sessionsNot enough resourceThe interfaces are stateless, by design
  4. The eCommerce application While the backend is the master of records, the application layer does quite a lotIt manages all user centric resources…. Presentation managementManage user profile & preferences, identity management Campaign management Content management on top of the product catalogueManage eCommerce workflow & session ( provide store, shopping cart and all that Allow scale for Web Channel – The implementations of the Web Layer are quite crafty – but finally it works for the developers quite easilyThe two most basic techniques for Server Session State are using the http session and using a stateful session bean. The http session is the simple route and causes the session data to be stored by the Web server. In most cases this leads to server affinity and it can't cope with failover. Most app server vendors have implemented a shared http session capability that allows you to store http session data in a database that's available to all application servers.
  5. So these Applications are capable of serving pages which contains state transitions ( or session embedded in the page responses)
  6. How do we reuse this capability while exposing the APIsAll REST definitions are supposed to have resources – but the implementations provide no framework to link between resourcesThe implementations are quite crafty – but finally it works for the developers quite easily – session management is provided by the container.
  7. How do I manage client state & session? Changing backend is toughHow do I manage HUGE VOLUMEs of such sessions?My backend does not do analytics!
  8. We need a services layer in the middle to manage session state. So the solution will work by exposing RESTful APIs and managing stateful interactions by REST But before we go there – What is this services layer consisting of?
  9. The services layer is a logical architecture component. It can be implemented by number of components such as Application servers, databases, API management & exposure layer, analytics and so on. The good news is that the Façade Layer does not need to rebuild all the existing capabilities. The API Service Layer is a Façade on top of the existing capabilities.
  10. We need a Façade layer in the middle toHold the transient resources – which represents the state Expose REST APIs that allows access to these transient resource in RESTful mannerProtect the backend from the overhead of managing client stateIt is more of design principle – not so much about the actual implementation.
  11. This gels in well with the concept ofhypermedia as the engine of stateI am not going to dig into what HATEOAS and what it is not. It is one of the principles or constraints of REST -REST is defined by four interface constraints: identification of resources; manipulation of resources through representations; self-descriptive messages; and, hypermedia as the engine of application state.I would rather just use the most basic definition of Roy Fielding's often cited HATEOAS The next control state of an application resides in the representation of the first requested resourceEssentially every page representing a state and links in that page representing every possible transition from the current state.On a side note – why is HATEOAS difficult? Or for that matter REST difficult? Because there is no enforcement of the REST principle as a protocol or standard.
  12. Next action can be adding the product to a cart
  13. HATEOAS and REST is great, but,So what does it have to do with Session Management?
  14. What are the solution benefits of this pattern of introducing a API Façade in the middle & exposing REST APIsThat manages session state as part of state transition of the resourceLet us dig a little more to understand the responsibilities of the “ API Façade “ in this particular design pattern
  15. Let us again hypothetically take the shopping cart scenarioWhat all happens in the middle?Master system of record is somewhere out side the API Façade in the backendThe API Façade is however creating and managing the state transition of the cartIt manages the cart as a REST resourceThe stress of this diagram is the point that the stateful resources are mostly transient in nature. That is kept separate from the master records and transaction systems.
  16. Especially the stateful transient resources --- In other words, a server should not have to retain some sort of communication state for any of the clients it communicates with beyond a single request. REST sort of mandates that state be turned into resource state or the interaction be stateless. creating these resources and managing session in the middle has benefits for the Developer What is it?REST itself
  17. The greatest case in point for Session State in the facade is its simplicity State transition is easy – as each representation has the state transitions embedded as linksDeveloper does not have to control the stateDoes not have to maintain the entire state information and resubmit each timeLess network data to be submitted. Less programming over headCrafty APIPotentially the Developers would Love this kind of any API
  18. For the API team the benefits are even broaderThe API Façade can be implemented as highly scalable set of infrastructure – which is generally available as part of the platform. And importantly – like mentioned before - API Façade can have state persistent behind the Façade or it can reuse existing session management infrastructure ( like an App server running in the back)The developer or the provider does not have to to code for this Also the backend is not impactedMost of the time backend legacy systems are not designed to support these types of session state management, nor it is scalable for the backend to do so. The Services Layer introduced in the middle to handle millions of calls per day is able to manage the state information for such scenarios.
  19. The API Façade has additional capabilities to protect a session state ….Often we need a session parameter to be sent over the network…. Provides SSL offloading to secure session parametersCan provide time-expiry based sessionsCan identify replay attacks based on source and known request patternsCan disable specific clients by disabling rogue usersCan throttle illegally high request volumes so that backend is protected
  20. There are choices – How much data to be persisted in the sessionHow much can be in-memory How much should be persisted in the DBWhat should be sticky ( as in sticky session)It is easy to implement Business rules or data mapping rules on the server side.In the context of session / state – it is often required to think about different implementations.Session at http levelSession implementation at a container level – e.g. a java session beanSession in the DBDifferent implementation approaches are possible.
  21. API usage Analytics is a broad area. We know It is done well by introducing an API Façade in the middleWhen it comes to a session based interactions – we have an unique opportunity to track the entire session and generate analytics on progress of a workflow or a sequential transaction…Like what % of clients did progress halfway through but did not complete a transactions?
  22. when session management would be used versus when it's not? what are the key characteristics? how do i decide?
  23. If it is too much overhead to send back the entire context data each timeThere are two options to authenticationAuthenticate once and issue an authenticated session and continue to use that. Or. Each request will need to be authenticatedIf the interactions do not mandate a sequence of calls - or you do not require three legged Oauth kind of authentication - I would recommend sessionless interactionSometimes authentication in each request is costlyIn case of Oauth you can not avoid the authentication in a simple way. Authentication of developer and the user is concerned. You can not do the Oauth dance for every single request. It is very costly to do Oauth. So you want to reuse the authenticated token for longer than one interaction. In a way that is a session. BTW, Signed requests are much stronger than mere session ids. { Cross-site request forgeries will be mitigated with this scheme. By authenticating all requests with a shared secret we don't have any time-bound sessions or timeouts. Just fire whenever you want. The persistent shared secret is much more sensitive than a temporary session id. A cross-site scripting attack will steal the shared secret which is much worse than session hijacking. This means the scheme is less suitable for browsing sessions and more suitable for machine-to-machine communication. }Evidently signed request is a good approach over authenticated session, but too much for a phone based application to implement
  24. Information associated with Session or “transient resource” should be minimalHandling larger chunks of session data is obviously heavy on performance
  25. Rules to expire session must be appliedUsability vs PerformanceIf the cart has to be long lived resource – it should be persisted outside the API Façade. Only transitional state should be persisted in the API Façade.