YOU ARE DOWNLOADING DOCUMENT

Please tick the box to continue:

Transcript
Page 1: Microservice-Based Architecture in the App Cloud

Microservice-based Architecture on the Salesforce1 Platform

 Paul Battisson, MVP, Technical Architect, Mavens Consulting  Sean Harrison, Technical Architect, Mavens Consulting

Page 2: Microservice-Based Architecture in the App Cloud

Paul Battisson Force.com MVP

Technical Architect, Mavens Consulting

@pbattisson

@forcedotcomcast

Page 3: Microservice-Based Architecture in the App Cloud

Sean Harrison Technical Architect, Mavens Consulting

@GizmoForce

Page 4: Microservice-Based Architecture in the App Cloud

Agenda

•  What are microservices anyway? •  Pattern 1 – The Gateway •  Pattern 2 – Synchronous Broker •  Pattern 3 – Asynchronous Broker •  Microservices on Salesforce1

•  Summary •  Q&A

Page 5: Microservice-Based Architecture in the App Cloud

What are microservices anyway?

Page 6: Microservice-Based Architecture in the App Cloud

Break the Monolith Business Capabilities – Products not Projects

Page 7: Microservice-Based Architecture in the App Cloud

Communication RESTful or Message Queues?

•  We will be showing our microservices communicating over a message queue

•  REST is most common pattern for synchronous communication

•  Message Queues for asynchronous

•  We are showing a message queue because:

•  Lots of people may not have seen one

•  Salesforce REST API would be better for REST based microservices architecture

Page 8: Microservice-Based Architecture in the App Cloud

Pattern 1 - The Gateway

Page 9: Microservice-Based Architecture in the App Cloud

Pattern 1 – The Gateway

Page 10: Microservice-Based Architecture in the App Cloud

Pattern 1 – The Gateway

1.  Microservice processes some information that requires interaction with Salesforce

2.  Microservice places message for Salesforce Gateway Microservice on message queue

3.  Gateway Microservice handles message from queue and calls appropriate function(s)

4.  Gateway Microservice functions call out to Salesforce REST API

5.  Salesforce REST API returns response

6.  Gateway Microservice handles and processes response as well as acknowledging processing of message

7.  Acknowledgement (possibly including processed REST API response) routed handled by originating microservice

8.  During processing, Gateway Microservice may place another message on queue to be handled by other microservices

Page 11: Microservice-Based Architecture in the App Cloud

Demo & Code! Please visit https://goo.gl/VsVRjk

Page 12: Microservice-Based Architecture in the App Cloud

The Microservice Part

index1.html

server.js

Page 13: Microservice-Based Architecture in the App Cloud

The Gateway and SFDC Part

server.js

SalesforceService.js

P1_Listener.cls

Page 14: Microservice-Based Architecture in the App Cloud

Pattern 2 – Salesforce Broker Synchronous

Page 15: Microservice-Based Architecture in the App Cloud

Pattern 2 – Salesforce Broker (Synchronous)

Page 16: Microservice-Based Architecture in the App Cloud

Pattern 2 – Salesforce Broker Synchronous

1.  Microservice processes some information that requires interaction with Salesforce

2.  Microservice places message for Salesforce Broker Microservice on message queue

3.  Broker Microservice handles message from queue

4.  Broker Microservice calls custom Broker Apex REST Endpoint

5.  Apex REST endpoint handles message and calls required apex code for message

6.  Broker endpoint responds with output from routed message

7.  Broker Microservice receives response and routes back to originating microservice via acknowledgement

8.  Acknowledgement (including Salesforce API response) handled by originating microservice

Page 17: Microservice-Based Architecture in the App Cloud

Demo & Code! Please visit https://goo.gl/xs3yFJ

Page 18: Microservice-Based Architecture in the App Cloud

Microservice Posts to a Queue

index1.html

server.js

Page 19: Microservice-Based Architecture in the App Cloud

Gateway Microservice Passes Information Through

SalesforceService.js

P2Listener.cls MessageHandlerContact.cls

Page 20: Microservice-Based Architecture in the App Cloud

Pattern 3 – Salesforce Broker Asynchronous

Page 21: Microservice-Based Architecture in the App Cloud

Pattern 3 – Salesforce Broker (Asynchronous)

Page 22: Microservice-Based Architecture in the App Cloud

Microservices on Salesforce1 Doing it on the platform

Page 23: Microservice-Based Architecture in the App Cloud

Microservices on Salesforce1

Page 24: Microservice-Based Architecture in the App Cloud

Demo & Code!

Page 25: Microservice-Based Architecture in the App Cloud

Microservices on Salesforce1

P4_Microservice.cls

Message_QueueTrigger.trigger

Page 26: Microservice-Based Architecture in the App Cloud

Microservices on Salesforce1

P4_Broker.cls

Page 27: Microservice-Based Architecture in the App Cloud

Microservices on Salesforce1

P4_Microservice.cls

Page 28: Microservice-Based Architecture in the App Cloud

Recap

Page 29: Microservice-Based Architecture in the App Cloud

Recap

•  Salesforce can be a first class player in a microservice architecture

•  Your situation will dictate the best pattern(s) to apply

•  Adoption takes time

•  Code samples and information available at: https://github.com/seanhharrison/DF15-microservices

•  We would love your feedback

•  On the session

•  On how you are (or could be!) using microservices

Page 30: Microservice-Based Architecture in the App Cloud

Share Your Feedback, and Win a GoPro!

3 Earn a GoPro prize entry for each completed survey

Tap the bell to take a survey 2Enroll in a session 1

Page 31: Microservice-Based Architecture in the App Cloud

Questions? @pbattisson

@GizmoForce

Page 32: Microservice-Based Architecture in the App Cloud

Thank you


Related Documents