Data Access Component Library 2 Component Library 3 • Compile-time contract validation • Local operations • Easier to reason about • Expensive to scale application • Hard to scale data access • Upgrades are long and costly
Photo Share Service Photo Share Service Thumbnail Service Photo Share Service Thumbnail SharedLib-v7 Photo Share Service SharedLib-v1 Photo Share Service node.js Thumbnail Service .NET Photo Share Service V1 Thumbnail Service V1 Thumbnail Service SharedLib-v7 Thumbnail Service V2 SharedLib-v1
(Microservices) • 1 service instance per VM • Slow deployment & upgrades • Slow scaling of roles up/down • Emulator for development • Many microservices per machine/VM • Fast deployment & upgrades • Fast scaling of microservices up/down • Single machine cluster for development Cloud Services vs Service Fabric
Application Worker role Worker role Worker role Worker role Worker role Storage queue Service Bus Azure cache Redis Azure load balancer Operational Insights Table Storage Azure SQL database Blob Storage
cache Redis Azure load balancer Node Service Fabric cluster Node Stateless Worker Service Node Node Node Stateless Web Service Stateless Worker Service Stateless Worker Service Stateless Worker Service Stateless Web Service Stateless Worker Service Operational Insights Blob Storage
Your code, etc. PC/VM #2 Service Fabric Your code, etc. PC/VM #3 Service Fabric Your code, etc. PC/VM #4 Service Fabric Your code, etc. PC/VM #5 Service Fabric Your code, etc. Your code, etc. (Port: 19080) Web Request (Port: 80/443/?) Cluster supports 1,000s of nodes is self repairing, and scales-in and out
services! fabric:/app/job1 fabric:/app/job2 fabric:/app/job3 MyApp Type 4.0.0 Web Service Type 1.0.0 User Service Type 1.5.0 Session Service Type 1.2.0 Authentication Service Type 3.1.4 Job Runner Service Type 1.2.0 fabric:/app/users fabric:/app/sessions fabric:/app/auth fabric:/app/job1 fabric:/app/job2 fabric:/app/job3 Service Fabric fabric:/app/web Registered service types Deployed named service instances
Middle-tier Compute Cache • Scale stateless services backed by partitioned storage • Increase reliability and ordering with queues • Reduce read latency with caches • Manage your own transactions for state consistency • More moving parts each managed differently Load Balancer
Front End (Stateless Web) • Application state lives in the compute tier • Low Latency reads and writes • Partitions are first class at the service layer for scale- out • Built in transactions • Fewer moving parts • External stores for exhaust and offline analytics Load Balancer Cold Data Stores For Exhaust (Optional)
• Graph of interconnected services • State typically scoped to the service • Variety of technologies used stateless services stateless services with separate stores stateful services stateless presentation services Monolithic application Microservices application
Node 1 P2 S S S P4 S P1 S P3 S S S • Services can be partitioned for scale-out. • You can choose your own partitioning scheme. • Service partitions are striped across machines in the cluster. • Replicas automatically scale out & in on cluster changes
care what your workload is • Service Fabric performs the placement and failover of containers in the cluster • Service Fabric works everywhere – same primitives • Docker containers on Linux • Windows containers on Windows • Guest Exes and/or Service Fabric Services can exist inside the container • A container can register endpoints with Service Fabric for discoverability & communication
gateway IoT Hub Device 1 Device 2 Device x Service Fabric Customer application 1 Customer application 2 Customer application m ... Storage (Azure) Service admin Create instances Send device data Create instances Cold storage data offload Device batch data Device batch data Customer User https://azure.microsoft.com/en-us/documentation/samples/service-fabric-dotnet-iot/
Fabric Billions of transactions per week Azure Document DB 4 trillion requests each week Azure Event Hubs 1.6 million DBs Azure SQL Database 500 million evals/sec Bing Cortana 1.1M devices Microsoft Intune … and more IoT Hub Skype for Business Power BI CRM Dynamics