Presentation is loading. Please wait.

Presentation is loading. Please wait.

SERVICE FABRIC Haishi DX, 2016. Agenda Basic concepts Exercise 1: Creating a stateless Calculator web API. Exercise 2: Testing stateful service failover.

Similar presentations


Presentation on theme: "SERVICE FABRIC Haishi DX, 2016. Agenda Basic concepts Exercise 1: Creating a stateless Calculator web API. Exercise 2: Testing stateful service failover."— Presentation transcript:

1 SERVICE FABRIC Haishi DX, 2016

2 Agenda Basic concepts Exercise 1: Creating a stateless Calculator web API. Exercise 2: Testing stateful service failover.

3 BASIC CONCEPTS

4 Service Fabric Overview Build cloud-scale distributed applications Microservices architecture Proven service SQL Database, Document DB, Intune, Power BI, Skye for Business, Cortana, Data Factory… Run anywhere Azure, on-premises, Azure Stack, AWS Windows and Linux Container integration

5 Service Fabric Application Business Layer Data Layer Presentation Layer Web Role Worker Role Database

6 Separation between workload and resources

7 Stateless vs. Stateful add(a, b) add (3,5) 8 add(a) add (3) 3 38 add (5)8

8 Scaling stateless service add(a, b) Load balancer add(a, b)

9 Scaling stateful service add(a) Load balancer add(a) 5 3

10 Scaling stateful service – externalize state add(a) Load balancer add(a) 5 3 8

11 Scaling stateful service - affinity add(a) Load balancer add(a) 3 8

12 Load balancer add(a) Scaling stateful service - replication 3 3 3 8 8 8

13 Scaling stateful service - partition routing add(a) 88866644 4

14 Service Fabric cluster

15 EXERCISE 1 Creating a stateless Calculator web API

16 Steps 1. Launch Visual Studio 2015 as administrator. 2. Create a new Service Fabric Application. 3. On New Service Fabric Service dialog, select the Stateless Web API template, and click on the OK button. 4. Update the ValuesController to container one method: [HttpGet] public int Add(int a, int b) { return a + b; }

17 Steps 5. Press F5 to launch the application. 6. Open a browser, and navigate to http://localhost:19080/explorer.http://localhost:19080/explorer 7. Expand the cluster tree all the way to the node level. Switch to DETAILS view. 8. Note down the port being used. 9. Open another tab in browser, and navigate to http://localhost:[port]/api/values/add?a=3&b=5. http://localhost:[port]/api/values/add?a=3&b=5

18 EXERCISE 2 Testing stateful service failover

19 Steps 1. Launch Visual Studio 2015 as administrator. 2. Create a new Service Fabric Application. 3. On New Service Fabric Service dialog, select the Stateful Service template, and click on the OK button. 4. Right-click the project and select the Publish… menu. 5. Publish to Local Cluster.

20 Steps 6. Open a browser, and navigate to http://localhost:19080/explorer.http://localhost:19080/explorer 7. Expand the cluster tree and observe how the replicas are distributed across nodes for the single partition. 8. In the cluster tree, find the node where the primary replica resides. Then, in the right panel, click on the ACTIONS -> Deactivate (restart) menu. 9. Observe that another node is elected as primary. 10. Modify Local.xml under the ApplicationParameters folder to change the number of partitions to 2. 11. Redeploy the application and observe in Service Fabric Explorer how partitions and replicas are distributed.


Download ppt "SERVICE FABRIC Haishi DX, 2016. Agenda Basic concepts Exercise 1: Creating a stateless Calculator web API. Exercise 2: Testing stateful service failover."

Similar presentations


Ads by Google