1. Trang chủ
  2. » Công Nghệ Thông Tin

Learning azure cosmos distributed applications 6 pdf

204 65 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 204
Dung lượng 5,48 MB

Nội dung

Learning Azure Cosmos DB A beginner's guide to creating scalable, globally distributed, and highly responsive applications using Cosmos DB Shahid Shaikh BIRMINGHAM - MUMBAI Learning Azure Cosmos DB Copyright © 2018 Packt Publishing All rights reserved No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews Every effort has been made in the preparation of this book to ensure the accuracy of the information presented However, the information contained in this book is sold without warranty, either express or implied Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals However, Packt Publishing cannot guarantee the accuracy of this information Commissioning Editor: Sunith Shetty Acquisition Editor: Chandan Kumar Content Development Editor: Amrita Noronha Technical Editor: Nilesh Sawakhande Copy Editor: Safis Editing Project Coordinator: Shweta H Birwatkar Proofreader: Safis Editing Indexer: Aishwarya Gangawane Graphics: Tania Dutta Production Coordinator: Aparna Bhagat First published: M ay 2018 Production reference: 1290518 Published by Packt Publishing Ltd Livery Place 35 Livery Street Birmingham B3 2PB, UK ISBN 978-1-78847-617-1 www.packtpub.com mapt.io Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career For more information, please visit our website Why subscribe? Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals Improve your learning with Skill Plans built especially for you Get a free eBook or video every month Mapt is fully searchable Copy and paste, print, and bookmark content PacktPub.com Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy Get in touch with us at service@packtpub.com for more details At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks Contributors About the author Shahid Shaikh is an engineer, published author, and a blogger He has written tons of tutorials on Node.js and various databases on his blog He is a believer in open source and almost all his source code is on GitHub He has also developed and launched a SaaS product called Spark to handle content sharing automation Currently, he is building a next-generation email marketing tool called Hashmailer I would like to acknowledge my parents for supporting me throughout the book-writing phase I had to work on weekends and cancel lots of plans to deliver the chapters on time, and my family and friends canceled various things because of me and supported me while I was writing the book, which I am very thankful for Backup and restore Cosmos DB automatically takes backups of all your data and keeps it updated at regular time intervals The automatic backup operations are done without affecting the performance or availability of your database operations Cosmos DB backups are stored separately, in another storage service, and those backups are globally replicated for high time availability and to avoid regional disasters The automatic backups are made for scenarios when you accidentally delete your Cosmos DB container and later require data recovery The automatic backups are taken every four hours and at least two copies of the latest backup are stored If you have deleted your database and information, you can contact the Azure team within four to eight hours to get your data back! The automatic backups are stored in the blog storage and are kept in the same region as your master data to provide high availability in the case of failure Automatic backups are also replicated across the region, in order to have a copy of the backups There is one key point you need to note, as mentioned: Azure automatically backs up your data every four hours and, if there is data corruption happening in your database, you will need to immediately drop or delete the database in order to save the backup from being corrupted Let's go ahead and see how one can deploy a custom app over the Azure network Deploying a custom app over the Azure network Azure provides various ways to deploy your application over their network Depending on the type of the project—that is, whether it is a web application, a batch processing application, or any other type of app—you will need to make a choice of which matches to their services For example, let's say we want to deploy the Node.js application on the Azure network; we then need to choose the type of server we want to host our application on Azure provides both Windows and Linux-based machines where you can deploy your application Let's see we want to create one in the Linux box Open the Azure portal and click on Virtual Machines from the left menu Click on the Create Virtual Machines button Refer to the following screenshot for help: Now, Azure will open up the compute screen; you will see lots of options regarding the operating system and virtual machine images Refer to the following screenshot for reference: I am going ahead with an Ubuntu Server Click on the Ubuntu Server and choose the right version of the Ubuntu operating system Use the Resource Manager deployment option and click on the Create button Refer to the following screenshot for reference: Now, give your virtual machine a name and choose an appropriate password You can select create new resource or use existing resources Set disk type to SSD for good performance Refer to the following screenshot for reference: On the next screen, choose a size or use the default size Skip option and then create the virtual machine Once the virtual machine is created, you can log in to it via the terminal using the following command: ssh username@ip Provide the password and you should be able to log in to the server Run this command whenever you a fresh Ubuntu install: sudo apt-get update sudo apt-get upgrade You can install Node.js using this command or download it from the official site: sudo apt-get install nodejs Now, if your code base is hosted at GitHub, you can use git command to download the source code: git clone Install the required dependencies using the npm install command and run the project In this way, you can deploy any custom application over the Azure network Now, let's move ahead to the last topic of our chapter: monitoring the network and traffic Monitoring traffic and usage Azure provides in-depth monitoring of your databases and their usage You can add monitoring alerts and check the network logs from your control panel itself The information is presented in a neat and proper way, to provide as many details on-screen as possible To check the monitoring, log in to Azure portal and click on Monitor in the left menu You should see a screen similar to the following screenshot: Now, click on Metrics in the left menu It should open a screen similar to what is shown in the following screenshot: You can change the filter and database to view the metrics for those databases You can also check the activity log of your account and resource group Click on activity log from the left menu and choose your resource group and date range to view the activities Refer to the following screenshot for reference: This is a great way to check for suspicious activity Now, for the usage part, you can go to the cost management + billing screen to view the current usage of your account I have got a free account for the month and need to upgrade it with a plan for further operations Explore more options in the Monitor screen and see what works for you Before we wrap up, let's quickly look at the security provided by Azure for our Cosmos DB Database security Cosmos DB data which is not moving around the network is encrypted and secured You can be rest assured that, even if attackers somehow get your stored data, it will be extremely tough for them to decrypt it Let's look over the key security features offered by Azure: Secured network: Cosmos DB provides an IP-based, rule-filtering firewall for advanced network protection Authorization: Cosmos DB authorize users using hash-based authentication codes User management: Cosmos DB provides secure user management using the resources concept Active directory support: Cosmos DB integrates with widely known and secure active directory authentication systems Turnkey distribution and replication: Using turnkey distribution, data is replicated and secured Failover handling: You can use automatic or manual failover Automated backups: Cosmos DB data is backed up regularly Database restoration: You can restore your database from the backup Monitor for attacks: By using monitoring, you can monitor attacks if they are happening to your server HTTPS/SSL/TLS encryption: All data traveling via the Azure network is encrypted Encryption at rest: All data stored in Azure machines is encrypted Compared to the industry at large, Azure offers some very advanced features Summary We have learned how to perform the global distribution of data in Cosmos DB and why it's important as well We also learned about failovers and the way to handle them We looked over how Cosmos DB performs the backup and how we can restore it in case of any emergencies We then moved ahead and talked about how we can deploy the custom application in Azure network With deployment comes monitoring Thanks to the Azure management portal, we can monitor our application usage and activities from the browser itself This is the last chapter of this book Before I go, I would like say thank you and wish you luck for your upcoming app using the Cosmos DB infrastructure If our book has helped you a bit during the process of building the app, let us know; your feedback is our oxygen I hope and wish that this book is of some value to you; if it is, then please shoot me an email at shahid@codeforgeek.com or tweet me at @codeforgeek Hoping to hear from you soon! Other Books You May Enjoy If you enjoyed this book, you may be interested in these other books by Packt: Stream Analytics with Microsoft Azure Anindita Basak, Krishna Venkataraman, Ryan Murphy, Manpreet Singh ISBN: 978-1-78839-590-8 Perform real-time event processing with Azure Stream Analysis Incorporate the features of Big Data Lambda architecture pattern in real-time data processing Design a streaming pipeline for storage and batch analysis Implement data transformation and computation activities over stream of events Automate your streaming pipeline using PowerShell and the NET SDK Integrate your streaming pipeline with popular Machine Learning and Predictive Analytics modelling algorithms Monitor and troubleshoot your Azure Streaming jobs effectively Learning Microsoft Azure Storage Mohamed Waly ISBN: 978-1-78588-491-7 Understand Azure Storage types and determine the appropriate one for your needs Design Azure Storage for Azure VMs according to best practices Design and implement your SQL Database on Azure according to best practices Learn how to work with Azure Backup Learn how to work with Azure Site Recovery Extend Azure Storage to StorSimple Monitor storage metrics and logs and customize the Azure monitoring dashboard Monitor and troubleshoot Azure Storage Leave a review - let other readers know what you think Please share your thoughts on this book with others by leaving a review on the site that you bought it from If you purchased the book from Amazon, please leave us an honest review on this book's Amazon page This is vital so that other potential readers can see and use your unbiased opinion to make purchasing decisions, we can understand what our customers think about our products, and our authors can see your feedback on the title that they have worked with Packt to create It will only take a few minutes of your time, but is valuable to other potential customers, our authors, and Packt Thank you! ... Microsoft Azure Cloud and Cosmos DB: Azure features Azure as a service, platform, and infrastructure (SPI) Azure components Getting started with Azure Azure Cosmos DB Azure Cosmos DB features Azure Cosmos. . .Learning Azure Cosmos DB A beginner''s guide to creating scalable, globally distributed, and highly responsive applications using Cosmos DB Shahid Shaikh BIRMINGHAM - MUMBAI Learning Azure Cosmos. .. into Azure Let''s dive into Azure Cosmos DB now Azure Cosmos DB Azure Cosmos DB is Microsoft''s globally distributed, multi-model database with scaling at the click of a button You can scale Azure

Ngày đăng: 21/03/2019, 09:38

TỪ KHÓA LIÊN QUAN