Share
APIs, Microservices & Co. mit .NET – von Null auf Hundert: Pragmatische End-to-End-Lösungen im Microservices-Umfeld
Das Schlagwort „Microservices“ ist in aller Munde. Angetrieben durch die zahlreichen Nachteile einer monolithischen Architektur wollen Microservices und damit verbundene Design Patterns und -Ideen das scheinbare Allheilmittel sein. In diesem Workshop klärt Christian Weyer über den Mythos Microservices auf: was sind sie, was sind sie nicht, wann setzt man sie ein – und vor allem: wie baut und betreibt man Microservices in der .NET-Welt? Und wie passt das wichtige Thema UI in all diese Diskussionen? Sehen Sie Architekturansätze in Aktion und erleben Sie Technologien wie Discovery, Web API, SignalR, Message Queuing, Containers, SPAs & Co. im praktischen Einsatz. Versuchen wir also gemeinsam langweilige Architekturthemen ein bisschen spannend zu machen.
Christian Weyer PRO
Transcript
83 slides
-
APIs, Microservices & Co. mit .NET – von Null auf
Hundert Pragmatische End-to-End-Lösungen im Microservices-Umfeld Christian Weyer @christianweyer CTO & Principal Consultant -
§ Co-founder, co-owner and principal consultant at Thinktecture AG §
Focus on § Mobile & web-based application architectures § Interoperability, cross-device § Pragmatic end-to-end solutions § Microsoft MVP for ASP.NET (Architecture) ASPInsider, AzureInsider § Google GDE for Web Technologies § [email protected] § @christianweyer Christian Weyer Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 2 -
§ End-to-End: APIs in perspective § Microservices § Common Microservices
Approaches & Patterns § Being pragmatic § Building Microservices with .NET § UIs & Microservices § What about Azure? § Cross-Platform Clients § Summary Topics Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 3 -
§ We have been doing .NET development for 16 years
§ This is really mature platform § We have been doing .NET Core development for over 2 years § This is really a young and immature platform § It has been a long and tough journey already with .NET Core § The community is not happy about the process & the results so far § .NET Core 2.0 together with .NET Standard 2.0 seems to be the ‘real’ first version o .NET Core § Will be out late summer/autumn 2017 § Certain things do not yet work with .NET Core § Push Services with SignalR (will show up in 2.0) § Not all 3rd party libs may already work The Case about .NET Core Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 4 -
APIs in perspective Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices &
Co. mit .NET – von Null auf Hundert 5 -
§ APIs are an important part of an overall, end-to-end
architecture § APIs can have different shapes: RPC-ish, CRUD-ish, REST-ish etc. § APIs are an entry point into a system or a service (microservice, FTW!) § Consumer-initiated use cases define the abilities of an API § Microservices are one possible incarnation of fleshing out systems with APIs APIs are not alone in this world Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 6 -
Microservices demystified Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co.
mit .NET – von Null auf Hundert 7 -
Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET
– von Null auf Hundert 8 -
Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET
– von Null auf Hundert 9 -
Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET
– von Null auf Hundert 10 -
§ “Cloud” § “Server” § “ESB” § “API” § XML
§ JSON § REST § HTTP § SOAP § WSDL § Swagger § Docker § Mesos § Service Fabric § Zookeeper § Kubernetes § SQL § NoSQL § MQTT § AMQP § Scale § Reliability § “Stateless” § “Stateful” § OAuth2 § OpenID § X509 § Java § Node § C# § OOP § DDD Services are not… https://lostechies.com/jimmybogard/2016/06/03/what-microservices-is-not/ Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 11 -
§ Docker / containers § Azure / AWS § Serverless
§ Feature flags § Gitflow § NoSQL § Node.js § No more than 20 lines of code in deployed service § AWS Lambda § Service Fabric Microservices are not… https://lostechies.com/jimmybogard/2016/06/03/what-microservices-is-not/ Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 12 -
§ Focused around a business domain § Technology-agnostic API §
Small § Autonomous Microservices are … https://lostechies.com/jimmybogard/2016/06/03/what-microservices-is-not/ Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 13 -
§ Autonomy § Single Responsibility § Isolation § Exclusive State
§ Mobility § Asynchronous Communication Core Ideas of Microservices http://jonasboner.com/bla-bla-microservices-bla-bla/ Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 14 -
§ Conway’s Law § „Organizations which design systems ... are
constrained to produce designs which are copies of the communication structures of these organizations.“ § Teams are created to solve a certain business problem § If you can afford it § If you can build those teams § Communication is tough, though! One of the Core Ideas of Microservices https://lostechies.com/jimmybogard/2016/06/03/what-microservices-is-not/ Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 15 -
§ Which degree of autonomy is good? § It depends
– really J § Synchronous communication may not be bad per se § Distinct, isolated data stores make decoupling, versioning easier § But may increase complexity § Messaging needs… messages – which need to be agreed upon § The more you decouple & the more you isolate, the more you may run into (unwanted or unneeded) complexity Autonomous – the Holy Grail Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 16 -
When to do Microservices https://martinfowler.com/microservices/#when Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs,
Microservices & Co. mit .NET – von Null auf Hundert 17 -
§ A lot of projects fail because of overly complex
architectures - sadly Please: KISS ! Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 18 -
Microservices Approaches & Patterns Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices
& Co. mit .NET – von Null auf Hundert 19 -
§ CRUD § DDD § ES § CQRS § WTF…
Architectural Styles Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 20 -
CQRS https://martinfowler.com/bliki/images/cqrs/cqrs.png Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co.
mit .NET – von Null auf Hundert 22 -
Select Microservices Approaches & Patterns Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs,
Microservices & Co. mit .NET – von Null auf Hundert 23 -
§ Web APIs § API Styles § RPC § OData
§ GraphQL § REST § Push Services § WebSockets § HTTP/2 § Relaying Open & Interoperable Interfaces Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 24 -
§ This can be like a religious war L §
REST-ful guidelines – really? § MS: https://github.com/Microsoft/api-guidelines § Zalando: https://github.com/zalando/restful-api-guidelines To REST – or not? Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 25 -
§ If you are not a hardcore REST-afarian you may
want to have your interfaces described / documented § Technical for tooling § Human readable § Swagger / OpenAPI may help Describing Web APIs Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 26 -
§ Services should register themselves and be discoverable § Consumers
need to find services § E.g. with DNS, Consul § Consider discovery-as-a-service when running in a Cloud Discovery & Registry Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 27 -
§ Most likely there are not a lot unsecured microservices
to be consumed § Think about trusted subsystems where possible § Need to authenticate applications and users § Separate authentication into its own microservice § Apply authorization logic in the functional microservices § Standards may help § OAuth2 § OpenID Connect Security Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 28 -
§ Async message passing § Different message exchange patterns at
your hand § RabbitMQ as a broker-based system is a good option for many use cases § ZeroMQ may be your choice if you do not need a broker, but fast communication § Consider queue-as-a-service when running in a Cloud Messaging & Queuing Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 29 -
§ Always think end-to-end § Letting consumers know that something
important changed improves UX § Push data from services to consumers § Platform push § APNS § Windows Push Notification Services § Google Firebase Cloud Messaging § Use with PWAs § Application push § WebSockets, e.g. with SignalR Push Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 30 -
§ Be stateless ;-) § Seriously, try to omit permanent
state in memory § State is held on the consumer-side or in the backend (data stores) § Be able to fail fast § Be able to just scale-out by adding a new instance of your microservice (process) Scalability Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 31 -
§ Decouple your microservices § One service should not bring
down the entire system § Add resiliency code to consumers § Errors will happen, you will have to retry connections and calls § Consider patterns like circuit breaking § Monitor your microservices and report to central service § Perform health checks § Use dashboards to analyze data § Use escalation paths for critical issues § Maybe intentionally stress your microservices § E.g. Netflix’ ChaosMonkey Availability Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 32 -
§ Build early, build often § Deploy and test early
§ During development think about containers for complex setups § E.g. Docker container for identity management solution with databases, Active Directory, certificates etc. § For production § VMs may be a good fit – automatically generated by tools § Containers may be a more lightweight option § Consider real machines for max performance Deployment Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 33 -
§ API Versioning § Validation § Testing § Gateways §
… and so on ... And much, much more Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 34 -
Being Pragmatic Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co.
mit .NET – von Null auf Hundert 35 -
§ Those are just approaches & patterns – not rules
J § Pick and choose wisely, really § There are not a lot of Netflix, Facebooks, Twitters out there § Sample application for this workshop picks a few of them § And yes: it is a very simple scenario Pragmatic == Use-Case-driven Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 36 -
Microservices with .NET Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices &
Co. mit .NET – von Null auf Hundert 38 -
§ Web site to create order and submit them §
We do not really have this Web site, but simulate it with PostMan J § Order service (.NET) § Shipping service (node.js) § Web App (Desktop or mobile) § Gets data from Order service § Subscribes to get updates for shippings § System should be stable if one significant service is not available DEMO - A small sample application Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 39 -
§ ASP.NET Web API for building convention-based Web APIs §
Makes working with JSON data easy by using JSON.NET § Can be used with IIS or any other Windows process § OWIN (Open Web Interface for .NET) § Standard interface between .NET web servers and web applications § Decouple server and application § We can host in IIS § Sometimes to heavy § Need to be able to control hosting process(es) § Topshelf makes building Windows Services easy § http://topshelf-project.com/ Web APIs & Hosting: ASP.NET Web API & Topshelf Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 40 -
§ Documenting Web APIs with Swagger § http://swagger.io/ § Tooling
ecosystem § E.g. Swagger Codegen § http://swagger.io/swagger-codegen/ § Swashbuckle uses .NET reflection to provide as-goog-as-possible automatic documentation § https://github.com/domaindrivendev/Swashbuckle Documenting Web APIs: Swagger Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 41 -
§ GZip-ped JSON responses can save a lot of bandwidth
§ ASP.NET on IIS has built-in support § Self-Host § Need to provide a middleware for OWIN... § Nuget package Microsoft.AspNet.WebApi.Extensions.Compression. Server.Owin GZip support in ASP.NET Web API Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 42 -
§ Services should be discoverable § Consumers need to know
what services are available where § Simple DNS mapping may already be sufficient § Consul § Server solution for service registration & discovery § Can be run as a failover cluster § Nanophone § .NET lib for service registration & discovery § Supports Consul § https://github.com/lvermeulen/Nanophone Registry & Discovery: Consul & Nanophone Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 43 -
§ OAuth2 & OpenID as standards for Web and mobile
authentication § Set of standardized Web APIs to transform credentials to tokens § Open source IdentityServer is the de-facto standard toolkit for .NET § IdentityServer4 is built on .NET Core § https://identityserver.io/ § Can be seen as its own Microservice AuthN & AuthZ: Identity Server & OWIN Middlewares Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 44 -
§ Open source message broker § https://github.com/rabbitmq/rabbitmq-server § Cross-platform §
Built on Erlang § Very popular in the worldwide community § Lots of language bindings / APIs available § Supports various message exchange patterns § Simple point-to-point, RPC § Worker queues, Publish / Subscribe etc. § Can be run on-premises & in the cloud § https://www.cloudamqp.com/ § https://azuremarketplace.microsoft.com/en-us/marketplace/apps/bitnami.rabbitmq Messaging: RabbitMQ Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 45 -
§ EasyNetQ as strongly-typed messaging layer for RabbitMQ § Serialize/deserialize
.NET types § Node.js equivalent EasyNodeQ: https://github.com/sfrooster/EasyNodeQ § https://github.com/EasyNetQ/EasyNetQ § Alternative RabbitHarness § https://github.com/pondidum/RabbitHarness § Mapping types to each other with AutoMapper § Object-to-object mapper based on conventions § E.g. map DTOs to messages & vice versa Messaging: EasyNetQ & AutoMapper Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 46 -
§ Web APIs with Restify § EasyNodeQ for RabbitMQ messaging
§ node-consul for registering with Consul § Using TypeScript as strongly-typed programming language § Optional packaging as Windows .EXE Node.js – As Microservices should be technology-agnostic… Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 47 -
§ Push-style data communication on the web § WebSockets, Server-Sent
Events or Long Polling § Two basic programming models § Persistent connections § Hubs § Hubs offer a business logic level abstraction that suits a lot I use cases § A hub mimics a push service instance in memory which is able to push data to subscribed clients § SignalR client-side APIs available for a lot of platforms § .NET, JavaScript, ObjectiveC etc. Push Communication: ASP.NET SignalR Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 48 -
§ Host your web-based client applications in their own processes
§ Separate, independent deployment from APIs § Static files middleware can serve – well: static files UI: Self-Hosted Angular App Service with OWIN Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 49 -
§ Systems should be robust § Subsystem can go offline
without breaking the entire system § Always validate your incoming data § Always be defensive when crossing boundaries § Handle exceptions especially on system boundaries § E.g. in the Web API or WebSockets layer § Log the exception details (with correlation data) § Provide meaningful error information for consumers Defensive Programming & Exception Handling Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 50 -
§ YALL? § Yet another logging lib? § SeriLog for
logging structured event data § https://serilog.net/ § Uses sinks for writing log events to storage in various formats § Large community offering lots of sinks § https://github.com/serilog/serilog/wiki/Provided-Sinks § Seq is a log server built for structured logging techniques § Provides a web GUI § Support for Serilog, ASP.NET Core, NLog, as well as Node.js, Python etc. § https://getseq.net/ Logging: SeriLog & Seq Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 51 -
§ Monitoring system resources is key to understand the health
of a system § There a countless monitoring solutions on the market § Hard to choose the ‘right’ one § E.g. Warden § Open source monitoring tools built with .NET § Watchers for performing check on the given resource (e.g. API or database) § Integrations as external services configured to work with § https://getwarden.net/ § E.g. Prometheus § Open source systems monitoring & alerting toolkit originally built at SoundCloud § https://prometheus.io/ § https://github.com/phnx47/Prometheus.Client.Owin Monitoring Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 52 -
§ Containers with Docker § Software container platform § Everything
required to make a piece of software run is packaged into isolated containers § Docker for Windows § Run Docker containers on Windows § Still uses Linux underneath § https://www.docker.com/docker-windows § Container orchestrators § E.g. Docker swarm, Kubernetes Deployment & Operation Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 53 -
Running in Azure Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices &
Co. mit .NET – von Null auf Hundert 54 -
§ We have several options for running our Microservices in
Azure § VMs § Cloud Services § App Services § Service Fabric § Azure Container Service § Azure Functions § German Azure Cloud is a big win for customers § Completely isolated from the ‚other‘ Azure Clouds Microsoft Azure as IaaS, PaaS & SaaS Cloud Platform Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 55 -
User Interfaces Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co.
mit .NET – von Null auf Hundert 56 -
§ When thinking end-to-end, there are microservices with and without
user interfaces § Need a way to compose Web UIs consisting of several „sub-UIs“ § Can be done server-side § Can be done client-side, SPA-style – aka cross-platform Smart Clients § Sample: http://lvm-it.github.io/ Microservices can contain a UI Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 57 -
§ … ... Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices &
Co. mit .NET – von Null auf Hundert 58 -
Modern cross-platform UIs Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices &
Co. mit .NET – von Null auf Hundert 59 -
Single-platform vs. multi-platform vs- cross-platform Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs,
Microservices & Co. mit .NET – von Null auf Hundert 61 -
Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET
– von Null auf Hundert 62 -
§ Modern lifestyle, modern way of working § Data and
processes need to be mobile, not just the devices we use § Reach is important § Boundaries are blurring – and will vanish § User experience will become an even more important part of software development § Facing new challenges § Building UIs with one technology approach § But optimized for certain platforms and/or form factors “Mobile-First” Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 63 -
It’s a feature But that doesn’t look like a native
application! Exactly. Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 64 -
§ Service-based architectures § Web / REST APIs § Use
any platform server-side § Express or Restify § Jersey § ASP.NET Web API § Push Services § socket.io § SignalR § Consider Offline-first § Heavily influences your architecture and entire project Target architecture HTTP HTTPS WebSocket Service A Service B Service C Web APIs (ASP.NET, Node.js, …) HTML5-Application (Single-Page Application) Web Cordova Electron Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 66 -
The web as a platform Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs,
Microservices & Co. mit .NET – von Null auf Hundert 67 -
§ Web browser & HTML5 as a powerful platform §
JavaScript & TypeScript as application programming languages § Angular as smart client application framework – or React, or… § Flexible layouts with CSS3 & flexbox Real applications Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 68 -
§ Client-side single page applications (SPA) § Features § Consequently
component-driven § Metadata-driven § Tooling ecosystem § Focus on proven pattern and separation of concerns § Components, views, view models § Services and dependency injection Component-based applications with Angular Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 69 -
Web & native platforms Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices
& Co. mit .NET – von Null auf Hundert 70 -
§ Toolkit and framework for building native application shells for
our web apps § Make ‘app apps’ from ‘web apps’ J § Uses native web view components to host the original web app locally § Provides framework and APIs via plugins to interact with underlying native platforms § CLI tools for automating project creation & build § We always need the native SDKs (e.g. iOS, Android, Windows) Mobile apps with Cordova JS HTML CSS Native wrapper Deploy to devices Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 71 -
Cordova architecture Mobile OS iOS Android Windows 10 UWP many
more Cordova Application Cordova Plugins Geolocation Notifications Contacts Media Camera Custom Plugins HTML Rendering Engine (WebView) Single Page App HTML JS CSS Assets config.xml HTML APIs Cordova APIs OS APIs OS APIs Cordova Native APIs Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 72 -
Cordova platform support Android Blackberry 10 iOS Windows Phone 8
Windows (8.1 / 10, Phone 8.1) Cordova CLI MacOS, Windows, Linux MacOS, Windows, Linux MacOS Windows a Embedded WebView a x a x x Plugin Interface a a a a a Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 73 -
§ Create real desktop applications from web apps § Similar
to Cordova’s base idea § Target Windows desktop, macOS, and Linux § Marriage of Chromium and node.js § Independent of installed browsers on target machines § Does not need native SDKs to build final artifact § Access to native platform features § Electron API § Node modules ecosystem § Auto-updating and platform deployment Desktop applications with Electron Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 74 -
Electron architecture Desktop OS Electron Renderer Process (technically Chromium) Electron
Main Process (technically Node.JS) MacOS Windows Linux Your Single Page Application Electron API Your custom Node.JS modules IPC Remote Node.JS Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 75 -
§ Build automation is important for effective development, testing and
deployment § Gulp has been king for years § Large community § Lot of online resources § Many project experience § Webpack gains a lot of traction § Angular CLI is based on Webpack Build process Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 76 -
“Write once, run anywhere?” Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices
& Co. mit .NET – von Null auf Hundert 77 -
Summary Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit
.NET – von Null auf Hundert 78 -
§ APIs are not alone – they are an entry
point into systems / services § Microservices is an overloaded term, really § Know the approaches and patterns § Choose wisely § (Classic) .NET is mature and ready to be a base for your microservices § .NET Core will surely get there: 2.0 is around the corner § Be pragmatic with your microservices approach § Try to KISS! § End-to-end is important – and this includes cross-platform clients & UIs Summary Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 79 -
§ https://github.com/thinktecture/api-summit-2017-dotnet Workshop repository Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices
& Co. mit .NET – von Null auf Hundert 80 -
§ Event Sourcing § https://www.exceptionnotfound.net/pattern- overview-command-query-responsibility- segregation-and-event-sourcing/ § Eventual Consistency
§ https://github.com/rogeralsing/DistributedDe signPatterns/blob/master/CAP.md § CQRS § https://www.exceptionnotfound.net/pattern- overview-command-query-responsibility- segregation-and-event-sourcing/ § Consul § https://www.pluralsight.com/courses/consul- getting-started § https://github.com/rogeralsing/Microphone § https://hub.docker.com/_/consul/ § Nanophone § https://github.com/lvermeulen/Nanophone § Web API Versioning § https://www.hanselman.com/blog/ASPNETCor eRESTfulWebAPIVersioningMadeEasy.aspx § Hangfire § http://hangfire.io/ § RabbitMQ in Docker § https://hub.docker.com/_/rabbitmq/ § https://coderwall.com/p/uqp34w/install- rabbitmq-via-docker-in-os-x § EasyNetQ § http://easynetq.com/ Resources Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 81 -
§ Logging with SeriLog § https://serilog.net/ § Gathering los with
Seq § https://getseq.net/ § Monitoring with Application Insights § https://docs.microsoft.com/en- us/azure/application-insights/app-insights- windows-services § Monitoring with Warden § https://getwarden.net/ § .NET Architecture Guidance § https://www.microsoft.com/net/architecture § Docker & Windows § https://blog.sixeyed.com/how-to-dockerize- windows-applications/ § https://github.com/docker/labs/blob/master/ windows/modernize-traditional- apps/modernize-aspnet-ops/README.md § https://github.com/docker/labs/blob/master/ windows/modernize-traditional- apps/modernize-aspnet-ops/part-3.md Resources Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 82 -
§ Angular § https://angular.io § https://angular.io/docs/ts/latest/ guide/architecture.html § Bootstrap §
http://getbootstrap.com/ § Material § https://material.angularjs.org § Cordova § http://cordova.apache.org/ § Electron § http://electron.atom.io/ § https://github.com/electron/electron- api-demos § Gulp § http://gulpjs.com/ § Webpack § https://webpack.github.io/ § Angular CLI § https://cli.angular.io/ Resources Pragmatische End-to-End-Lösungen im Microservices-Umfeld APIs, Microservices & Co. mit .NET – von Null auf Hundert 83