1 / 59

Event driven application with Azure Cosmos DB

Event driven application with Azure Cosmos DB. Rafat Sarosh Principal Program Manager – Azure Cosmos DB rafats@microsoft.com @ rafatsarosh. BRK3159. Design Pattern. Solution. Tools & Technology. Event Notification. Order. Shipping. Print Label. Inventory. Order. Order received.

thummel
Download Presentation

Event driven application with Azure Cosmos DB

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Event driven application with Azure Cosmos DB Rafat Sarosh Principal Program Manager – Azure Cosmos DB rafats@microsoft.com @rafatsarosh BRK3159

  2. DesignPattern Solution Tools & Technology

  3. Event Notification

  4. Order Shipping Print Label Inventory

  5. Order Order received Queue Event Notification Shipping Inventory Print Label

  6. Order Order received Queue Event Notification Shipping Inventory Print Label

  7. Event Sourcing

  8. Applications Customer create, read, update and delete Slow performance, responsiveness and limit scalability No Audit. History is lost Updated Conflicts

  9. Applications Customer create, read, update and delete Log Add Address Update Phone Number Customer Login Add Phone Number

  10. Applications Customer Log Customer Login Address Update Phone Number Customer Login Customer Login Address Phone Number

  11. Applications Customer Applications Log Customer Login Address Update Phone Number Customer Login Customer Login Address Phone Number Decoupling Materialized View Integration with other system Auditing Debugging Teleporting

  12. Applications Customer Applications Microservices Log Customer Login Address Update Phone Number Customer Login Customer Login Address Phone Number Decoupling Easy Updates Software versions Fault Tolerant Debugging Stability

  13. Applications Kafka/Event Hub

  14. Applications

  15. AZURE COSMOS DB A FULLY-MANAGED GLOBALLY DISTRIBUTED MULTI-MODEL DATABASE SERVICE BUILT TO GUARANTEE EXTREMELY LOW LATENCY AND MASSIVE SCALE FOR MODERN APPS

  16. SQL Key-Value Column-family Graph Documents … more coming soon mongoDB Azure Cosmos DB Global distribution Elastic scale out Guaranteed low latency Five consistency models Comprehensive SLAs A globally-distributed, multi-model database service

  17. Change Feed Persistent log of records within an Azure Cosmos DB container. Documents presented in the order in which they were modified New Events Azure Cosmos DB Change feed

  18. Change Feed Scenarios Event Computing and Notifications Retail, Gaming, Content management Trigger a call to an API when a document is inserted or modified AzureNotification Hubs Azure App Service Azure functions Stream Processing IoT Processing, Data Science & Analytics Perform real-time (stream) processing on updates to data New Events Azure Stream Analytics Azure HDInsight Apache Spark Apache Storm Azure Cosmos DB Change feed Data movement Enterprise Data Management Move, clone, or archive data to cold storage AzureStorage Blob Azure Data Lake Azure Cosmos DB

  19. Event Sourcing for Microservices Trigger Action From Change Feed Persistent Event Store Microservice #1 Microservice #2 New Event … Azure Cosmos DB Change feed Microservice #N

  20. Materializing Views Application Azure Cosmos DB Materialized View Change feed

  21. Replicating Data Secondary Datastore(e.g. archive) Replicated Records CRUD Data Change feed Azure Cosmos DB

  22. Change Feed with partitions Consumer parallelization • Change feed listens for any changes in Azure Cosmos DB collection. It then outputs the sorted list of documents that were changed in the order in which they were modified.  • The changes are persisted, can be processed asynchronously and incrementally, and the output can be distributed across one or more consumers for parallel processing. The change feed is available for each partition key range within the document collection, and thus can be distributed across one or more consumers for parallel processing. Event/stream processing app tier Consumer 3 Consumer 2 Consumer 1

  23. What is Azure Functions?An event-based, serverless compute experience that accelerates app development Focus on code, not plumbing No infrastructure management Auto-scale based on your workload No wasted resources, pay only for what you use

  24. Boost developmentefficiency Integrate with Azure Application Insights Get near real-time details about function apps See metrics around failures, executions, etc. Use triggers to define how functions are invoked Avoid hardcoding with preconfigured JSON files Build serverless APIs using HTTP triggers Connect to data with input and output bindings Bind to Azure solutions and third-party services Use HTTP bindings in tandem with HTTP triggers Monitoring Triggers Bindings Define one API surface for multiple function apps Create endpoints as reverse proxies to other APIs Condition proxies to use variables Debug C# and JavaScript functions locally Use debugging tools in Azure portal, VS, and VS Code CI/CD Proxies Local debugging Save time with built-in DevOps Deploy functions using App Service for CI Leverage Microsoft, partner services for CD

  25. Gain flexibility and develop your way Write code in C#, JavaScript, F#, and Java Continuous investment in new, experimental languages Multiple languages Write stateful functions in a serverless environment Simplify complex, stateful coordination problems Add the extension to enable advanced scenarios Durable Functions Simplify coding for new users with native Azure portal Select from popular editors, like VS, VS Code, CLI, Maven* Dev options Choose from six consumption plans to run Functions Run your first million function executions for free Hosting options *VS and VS Code only support C#; Maven only supports Java

  26. Gain flexibility and develop your way Consumption AS Plan AS Environment Azure Stack Runtime IoT Edge Serverless Free, Basic, Standard, Premium Network isolation On-premises Functions on your server On devices Only pay for what you use; charges apply per execution and per GB second Gain all the advantages of Functions along with Microsoft’s financially-backed SLA and the always-on features of an App Service Plan Use a dedicated App Service cloud environment (ASE) that comes with network isolation for apps, greater scale, and secure connectivity to local vNets Bring the power of the entire Azure stack to your own data centers Run Functions on your local server; does not include the entire Azure stack Deploy custom Azure modules on IoT devices Hosting options

  27. Eventing in the cloud Events Event Handlers Blob Storage Serverless Code Resource Groups Functions Event Grid Azure Subscriptions Serverless Workflowand Integration Event Hubs Logic Apps CloudEvents Format Azure Media Service Storage Queues Buffering and Competing Consumers Event Hubs IoT Hub Service Bus Other Servicesand Applications Custom Events (anything) Hybrid Connections (WebSockets) AzureAutomation WebHooks(anything) CloudEvents Sources

  28. Azure Event Grid Fully-managed event routing Near real-time event delivery at scale Broad coverage within Azure and beyond Backbone of event-driven computing

  29. Benefits Focus on innovation and pay per event Ensure reliability and performance for your apps Unlock new scenarios for your apps Manage all events in one place

  30. Build applications efficiently Management SDKs Publish SDKs Consumption SDKs Event Schema Store .Net Python Java Node.js Ruby Go

  31. Ensure reliability and performance in your apps SLA backed 99.99% availability 24-hour retry with exponential back off for events not delivered 10,000,000 events per second per region High availability Massive scale-out High reliability

  32. Applications Customer Applications Log Customer Login Address Update Phone Number Customer Login Customer Login Address Phone Number

  33. Customer Applications

  34. Customer Applications

  35. Customer Customer Checkout Item Added Cart Checkout Cart Created Item Added Jet.Com Microservices Inventory Shipping

  36. AddressBook Customer CQRS Phone Change Contact Blocked Contact Created Display Name Change Skype Microservices Notification Service Spam Detection Service

  37. 911 Scenario Web App IoT Cosmos DB ChangeFeed Azure Function Event Grid

  38. Solutions Azure Cosmos DB / Change Feed / Azure Function/ Event Grid Event Notification / Event Sourcing / Microservice

  39. Q & A

  40. Top 10 reasons why customers useAzure Cosmos DB The 1st and only database with global distribution turnkey capability Deliver massive storage/throughput scalability database Provides guaranteed single digit millisecond latency at 99th percentile worldwide Natively supports different types of data at massive scale Boasts 5 well-defined consistency models to pick the right consistency/latency/ throughput tradeoff Enables mission critical intelligent applications Gives high flexibility to optimize for speed and cost Tackles big data workloads with high availability and reliability Provides multi-tenancy and enterprise-grade security Naturally analytics-ready and perfect for event-driven architectures

  41. Cosmos DB SDKcode

  42. Text layout (without bullet points)

  43. Text layout (without bullet points) Main topic: Segoe UI Semilight, size 28pt Segoe UI, size 20pt for second level Segoe UI, size 16pt for third level

  44. Text layout with bulleted text • Main topic: Segoe UI Semilight, size 28pt • Segoe UI, size 20pt for second level • Segoe UI, size 16pt for third level

  45. Example with longer headline textwrapping to a second line When the headline text is 2 lines, move this text block down to align to the lower blue guide If you don’t see guidelines, click on the View menu, and then check the box in front of “Guides” Use a “soft return” Shift + Enter to wrap text without adding extra line spacing

  46. Adjusting list levels • Main topic: Segoe UI Semilight, size 28pt • Segoe UI, size 20pt for second level • Segoe UI, size 16pt for third level Use the “Decrease List Level” and “Increase List Level” tools on the Home menu to change text levels. Try this: Place your cursor in the line of text that says “Segoe UI, size 20pt for second level” Next click the Home tab, and then on the “Decrease List level” tool. Notice how the line moves up one level. Now try placing your cursor in one of the top “Main topic…” line of text. Click the “Increase List Level” tool and see how the text is pushed in one level. Use these 2 tools to adjust your text levels as you work

  47. Bullet points layout with subtitleSet the subtitle to 20pt in the same text block, with character spacing Normal Move the text block down vertically to align to lower guide If you don’t see guidelines, click on the View menu, and then check the box in front of “Guides” Hyperlink style: www.microsoft.com

  48. Enter title text Secondary text

  49. Square photo layoutwith body text

More Related