Migrating Applications to the Cloud with Azure
eBook - ePub

Migrating Applications to the Cloud with Azure

Re-architect and rebuild your applications using cloud-native technologies

Sjoukje Zaal, Amit Malik, Sander Rossel, Jason Marston, Mohamed Wali, Stefano Demiliani

Share book
  1. 494 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Migrating Applications to the Cloud with Azure

Re-architect and rebuild your applications using cloud-native technologies

Sjoukje Zaal, Amit Malik, Sander Rossel, Jason Marston, Mohamed Wali, Stefano Demiliani

Book details
Book preview
Table of contents
Citations

About This Book

Modernize your apps with Microsoft Azure by moving web, desktop, and mobile apps to the cloud

Key Features

  • Decide which migration strategy is most suitable for your organization and create a migration roadmap
  • Move existing infrastructure to Azure and learn strategies to reduce cost, increase storage, and improve ROI
  • Design secure, scalable, and cost-effective solutions with the help of practical examples

Book Description

Whether you are trying to re-architect a legacy app or build a cloud-ready app from scratch, using the Azure ecosystem with.NET and Java technologies helps you to strategize and plan your app modernization process effectively.

With this book, you'll learn how to modernize your applications by using Azure for containerization, DevOps, microservices, and serverless solutions to reduce development time and costs, while also making your applications robust, secure, and scalable.

You will delve into improving application efficiency by using container services such as Azure Container Service, Azure Kubernetes Service (AKS), and more. Next, you will learn to modernize your application by implementing DevOps throughout your application development life cycle. You will then focus on increasing the scalability and performance of your overall application with microservices, before learning how to add extra functionality to your application with Azure serverless solutions. Finally, you'll get up to speed with monitoring and troubleshooting techniques.

By the end of this book, you will have learned how to use the Azure ecosystem to refactor, re-architect, and rebuild your web, mobile, and desktop applications.

What you will learn

  • Use DevOps and containerization technologies to modernize your applications and infrastructure
  • Build microservices using Azure Service Fabric
  • Develop scalable applications using Azure Functions
  • Manage and deploy your application code and database connectivity
  • Secure and monitor your applications in Azure effectively
  • Design for high availability and disaster recovery

Who this book is for

This book is for.NET and Java developers who want to modernize their applications using Azure. Solution architects and experienced developers interested in modernizing legacy applications using Azure will also find this book useful. Some prior understanding of cloud computing concepts will be beneficial.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Migrating Applications to the Cloud with Azure an online PDF/ePUB?
Yes, you can access Migrating Applications to the Cloud with Azure by Sjoukje Zaal, Amit Malik, Sander Rossel, Jason Marston, Mohamed Wali, Stefano Demiliani in PDF and/or ePUB format, as well as other popular books in Informatik & Systemverwaltung. We have over one million books available in our catalogue for you to explore.

Information

Year
2019
ISBN
9781839214035
Edition
1

Connecting to the Database

Databases are very important in software. When moving your databases to Azure, you have a few databases to choose from, ranging from traditional SQL databases to NoSQL databases. In this chapter, we're going to look at the various database options that are available to us. When you opt for the Microsoft stack, you'll likely use Azure SQL or Cosmos DB, but databases from other vendors, such as MariaDB and Redis, are also offered as PaaS or IaaS solutions.
The following topics will be covered in this chapter:
  • Working with Azure SQL
  • Connecting to SQL Server Management Studio
  • Connecting to Azure SQL from .NET Core
  • Connecting to Azure SQL from Java
  • Understanding Cosmos DB
  • Working with the MongoDB API
  • Working with the Redis cache database

Technical requirements

You will need the following tools to complete the examples in this chapter:
  • SQL Server Management Studio (SSMS): https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms
  • Visual Studio 2017: https://www.visualstudio.com/downloads/
  • Eclipse 2019: https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2019-09/R/eclipse-java-2019-09-R-linux-gtk-x86_64.tar.gz
The source code for this chapter can be downloaded here: https://github.com/PacktPublishing/Migrating-Apps-to-the-Cloud-with-Azure/tree/master/Chapter10.

Working with Azure SQL

SQL Server is Microsoft's flagship database. It was released almost 30 years ago and it's still going strong today. So, of course, Azure has its own options for running SQL Server databases. The costs for SQL Server databases range from about €4 (basic) to over €18,093 (business-critical 80 vCores and 4 TB), so there should be something between those price ranges that fits your needs.

Picking your version

You have two options when it comes to hosting a SQL Server database in Azure. You either go for Azure SQL Server, which gives you a nice database instance without much hassle, or you host a VM and install SQL Server on that. Azure SQL is a Platform as a Service (PaaS) solution, while a VM is an Infrastructure as a Service (IaaS) solution. Since the IaaS solution that's installing your database on a VM is basically the same as hosting your own on-premises version of SQL Server, except on a machine running in the cloud, we're not going to talk about that in this chapter. This chapter will focus on PaaS solutions.
If you're looking for IaaS solutions, Azure has plenty of VM images that come with preinstalled (SQL) databases, such as SQL Server 2008 all the way up to the newest release, in different versions such as Standard and Enterprise, and even with different service packs installed. You're not limited to SQL Server either; you can pick images with Oracle, Postgres, MySQL, MongoDB, Neo4j, and plenty of others. The IaaS solution is ideal for a rehost or lift-and-shift migration, as discussed in Chapter 1, Strategies for App Modernization Using Azure.
When you're looking for a SQL PaaS solution, your options are much more limited. There's Azure Database for MySQL, PostgreSQL, and MariaDB in preview, and then there's Azure SQL, which I'm going to discuss here. I'm not going to discuss all four SQL databases, but if you're interested in MySQL, PostgreSQL, or MariaDB, you can check out the links in the Further reading section at the end of this chapter. Azure SQL is not the same as the on-premises version of SQL Server. They share the same engine, but Azure SQL doesn't give you the same type of control that SQL Server gives you. This is inherent to PaaS because you're not controlling the infrastructure, so you don't have access to the underlying OS. That being said, for a lot of databases, the transition will be rather painless. All your SQL code is still supported, after all. As such, migrating to PaaS solutions can usually be done while refactoring, rearchitecting, or rebuilding. See the Further reading section at the end of this chapter for a side-by-side feature comparison.
You can also use the Data Migration Assistant (DMA see the Further reading section), which helps you by looking for compatibility issues, such as unsupported or partially supported features, in your current database and Azure SQL (or any other SQL Server database).
Microsoft recommends hosting SQL Server in a VM for quick migrations to Azure as it closely resembles what you have on-premises. However, there is a third option: the Azure SQL Database Managed Instance. It provides nearly 100% compatibility with the latest Enterprise edition of your on-premises SQL Server. In this chapter, we're not going to use this, though, as it's not (yet) available in all locations or on all subscription types, it's quite expensive (starting at over €1,000), and it can take up to 6 hours to create.

Creating an Azure SQL Database

Creating an Azure SQL Database is surprisingly easy. Follow these steps to do so:
  1. Either find your SQL databases or go to Create a resource and find SQL Database.
  2. In the blade that opens, select a subscription.
  3. Select or create a resource group.
  4. Give the database a name. This is your database, so it doesn't have to be unique across Azure.
  5. The next part is a little tricky; we need to create an actual server:
    1. Provide a name for your server; it has to be unique across all of Azure.
    2. Enter the name of your server's admin.
    3. Enter a password that meets the requirements (Azure will show you what those requirements are if you don't meet them).
    4. Confirm the password.
    5. Select a location.
    6. Keep Allow Azure services to access server checked. For non-development purposes, it's recommended to uncheck this option as it gives any Azure resource access to your server, even those not in your current subscription.
  6. Now, we can go back to the SQL database settings. We don't want an elastic pool right now.
  1. The pricing tier is interesting; you can go for the Basic tier here, which is already more than we need. I've picked standard with some extra DTUs:
  1. Leave the collation.
  2. When you have filled everything out, you can click Create and the SQL database will be created; this may take a few minutes:
Let's look at the settings that may not be familiar to you. First, there's a server you have to create. Even though Azure SQL is a PaaS solution, you get some control over your server, mostly in terms of backups and security, which will be discussed in Chapter 12, Securing Your Azure Services, and Chapter 14, Designing for High Availability and Disaster Recovery.
With a server, you have a set number of resources that you pay for during the month. When you have multiple databases with varying and unpredictable periods of usage, a server may be sitting idle a lot of the time and peaking a few times a day or week. To overcome this problem, Azure introduced SQL elastic pools, which autoscale individual databases within set parameters as necessary. So, databases under light loads consume fewer resources while databases under heavy loads consume more resources. By placing these databases in a pool, you can save costs since they can share resources.

Pricing tiers

The cost of your SQL database depends on two things: the size of your data and the number of DTUs you have. There are three DTU-based tiers: Basic, Standard, and Premium. The Basic tier gives you five DTUs and a maximum of 2 GB of data. A D...

Table of contents