Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ninja Azure Consultant

Similar presentations


Presentation on theme: "Ninja Azure Consultant"— Presentation transcript:

1 Ninja Azure Consultant
Microservices? Anton Boyko Microsoft Azure MVP Ninja Azure Consultant

2 Agenda What and why? Several examples Implementation checklist
What is microservice architecture approach and why should I care? Several examples Several examples of microservice architecture from real life projects Implementation checklist Several important points you need to consider while planning your microservice architecture What about Azure? What Microsoft Azure can offer for my microservices?

3 What and why?

4 Criteria Maintainability Monitoring Scalability Updates Onboarding
How easy is it to maintain the code? How easy is it to fix a bug? Monitoring How easy is it to monitor solution health? Scalability How easy is it to add new computin power and handle heavier load? Updates How easy is it to update solution to the newest version? Onboarding How easy is it to get onboard a new team member?

5 Spaghetti $conn = new mysqli($servername, $username, $password, $dbname); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT firstname, lastname FROM users"; $result = $conn->query($sql); if ($result->num_rows > 0) { echo "<table>"; while($row = $result->fetch_assoc()) { echo "<tr><td>"; echo $row["firstname"] . "</td><td>" . $row["lastname"]; echo "</td></tr>"; echo "</table>"; } else { echo "0 results"; $conn->close();

6 Spaghetti Maintainability Monitoring Scalability Updates Onboarding
Impossible Monitoring Almost impossible Scalability Sometimes possible Updates Requires shutdown Onboarding Highly demotivating

7

8 Monolith Application in which user interface and data access code are combined into a single program. Design philosophy is that the application is responsible not just for a particular task, but can perform every step needed to complete a particular function.

9 Monolith Solution Presentation Application Data NLB Server Server

10 Monolith Maintainability Monitoring Scalability Updates Onboarding
Mostly possible Highly depends on solution size Monitoring Possible Scalability Updates Requires shutdown Onboarding

11 Microservices Microservices is a variant of the service-oriented architecture (SOA) architectural style that structures an application as a collection of loosely coupled services. Microservices should be fine-grained and protocols should be lightweight. Application is easier to understand, develop and test.

12 Microservices Microservice 1 Presentation Application Data NLB
Server Server Server Presentation

13 Microservices Maintainability Monitoring Scalability Updates
Possible Monitoring Highly depends on solution size Scalability Updates Can be handled without shutdown Onboarding

14 Nanoservices Nanoservices is a microservices anti-pattern where each service is too fine grained. Nanoservice is a service whose overhead (communications, maintenance etc.) outweighs its utility.

15 Nanoservices User login Get categories Get goods Get my orders
Presentation Presentation Presentation Presentation Application Application Application Application Data Data Data Data User register Add category Get good by id Create order Presentation Presentation Presentation Presentation Application Application Application Application Data Data Data Data

16 Nanoservices Maintainability Monitoring Scalability Updates Onboarding
Almost impossible Monitoring Scalability Possible Updates Can be handled without shutdown Extremely depends on solution size Onboarding Sometimes possible

17 microservices = architecture

18 microservices ≠ golden hammer

19 SEVERAL examples

20 Online shop Identity Client Profile Admin Search Data Ad Social

21 Community portal Web Admin Rendering Identity Data Member Notification
Speaker

22 Implementation Checklist

23 Infrastructure components
Microservices hosts Configuration source Routing and/or autodiscovery engine Monitoring engine Logging engine

24 CQRS Synchronous queries Asynchronous commands
send request and wait for response with data it’s acceptable to join data on a client side Asynchronous commands send request and wait for command unique id use command id to check execution status handling distributed transactions that affect several microservices can be tricky commands should be idempotent

25 CAP theorem Consistency Partitioning Availability

26 Eventual consistency After command for data modification was received, it may take some time for new data to be available for querying write entity Client app API DB id = 42 Client cache write [ 42 ]

27 Eventual consistency After command for data modification was received, it may take some time for new data to be available for querying read list Client app API DB [ 1, 20, 50, … ] Client cache read [ 42, 60 ]

28 Eventual consistency After command for data modification was received, it may take some time for new data to be available for querying read list Client app API DB [ 1, 20, 42, 50, … ] Client cache read [ 60 ] remove [ 42 ]

29 What about Azure?

30 Azure Service Fabric Service Fabric itself is platform agnostic
Stateless and statefull services Service discovery Health monitoring Fault domains and upgrade domains Enterprise-ready

31 Fault and upgrade domains
Update 1 Node 1 Update 2 Node 2 Update 3 Node 3 Update 4 Node 4 Update 5 Node 5 Main Primary reserved Secondary reserved Microservice 1 1 2 3 Microservice 2 4 Microservice 3 5 Microservice 4 Microservice 5

32 Azure App Services .NET, Java, PHP, Node.JS, Python
Shared web farm, isolated web apps Configuration management Backups Sticky sessions Built-in MySQL database

33 Azure App Services NLB Server 1 CPU RAM Server 2 CPU RAM Server 3 CPU
Distributed file system App 1 root App 2 root App 3 root App 4 root App 5 root

34 Azure App Services NLB Server 1 CPU RAM Server 2 CPU RAM Server 3 CPU
Distributed file system App 1 root App 2 root App 3 root App 4 root App 5 root

35 Azure Functions Built on top of Azure App Services
Small and independent unit of work Designed for handling huge amount of small parallel independent executions Consider them as event handlers Triggers and bindings Can be chained to handle sequential workflow Dedicated and consumption pricing plans

36 Azure Functions

37 Azure Functions bindings
Type Service Trigger Input Output Schedule Azure Functions HTTP Blob Storage Azure Storage Events Azure Event Hubs Queues Queues and topics Azure Service Bus Storage tables SQL tables Azure Mobile Apps No-SQL DB Azure DocumentDB Push Notifications Azure Notification Hubs Twilio SMS Text Twilio SendGrid SendGrid

38 Azure functions quickstart
Create cross-platform desktop apps using JavaScript and Azure Sql Saturday 2017 Kyiv

39 Questions? Anton Boyko Microsoft Azure MVP Ninja Azure Consultant


Download ppt "Ninja Azure Consultant"

Similar presentations


Ads by Google