[MUSIC].
>> Hi again. In the next four episodes we will
touch upon the third section of the series,
that is, application development.
In this particular episode,
we will look at what it means to develop
applications with MySQL Flexible Server,
what are the top use cases,
architectures, and some best practices that need to be followed.
So let's get started. If you're a developer developing
with MySQL server hosted on-premises or in a VM,
there are a lot of roles and responsibilities that fall on you.
You not only have to manage the front-end applications,
build the schema and the queries that are
required to run successfully, but you also
need to manage a lot of other tasks and
processes like creating and managing a server,
maintenance, patching, performance, security,
networking, disaster recovery, and so on.
But if you're developing with MySQL Flexible Server
you need to only look at designing the schema,
building the queries, and optimizing them.
Azure Database for MySQL Flexible server provides
a fully managed service to look after
all the other tasks and processes for you.
This helps you save a lot of time and
efforts and ship the applications faster.
Now, adding on to that,
you can use your favorite tools and frameworks.
Whatever you're comfortable with,
be it MySQL Command line,
MySQL workbench or third party tools like
HeidiSQL or even tools like
Visual Studio Code where application and
database can be managed from
a single platform or GitHub which provides
a lot of deployment options for MySQL or like GitHub Actions.
The front-end can be built with any of the languages that you
are familiar with or content management systems like WordPress,
Joomla, Drupal or learning management systems like Moodle,
or e-commerce systems like Magento.
Thanks to the Azure ecosystem, you can
host your application on App Service, Web Apps, API Apps,
Function Apps, or on Azure Kubernetes Service, AKS,
which is particularly suitable for
microservices architecture or on Azure Linux or Windows VMs where
you would have to host the application
on a web server and manage it
yourself while the first two options are managed by solutions.
Now let us look at the top use cases for Azure Database for MySQL.
First being web applications.
It could be anything from a small personal blog on
WordPress all the way up to enterprise applications,
a lightweight lamp stack application,
or mission-critical Internet-scale applications as well.
Second, e-commerce and payment platforms.
Now, these e-commerce applications
can be built using platforms like
Magento or a custom application itself and either way,
flexible Tableau hosts data related
to transactions, inventory, etc.
The third and most interesting use case is gaming.
There are actually a lot of use cases
within gaming but one of them could be storing
multiplayer session data like player details, scores, etc.
MySQL can actually scale even during
very high traffic or sudden bursts of traffic.
Let's look at a reference architecture
for building an application from the first use case that is
a WordPress or Drupal application
using Azure Database for MySQL Flexible Server.
First we have a content delivery network powered by
Azure CDN Services which
routes the traffic through to Azure App Service.
Now the CDN can actually speed up
your application by caching very heavy images,
style sheets, or JavaScript libraries.
Now, the application itself can be
dockerised and placed in a Docker hub
or Microsoft Container Registry
or any other private container registries.
This Docker image is then pulled down to
the Azure App Service where the application
runs and this application will talk to
Azure Database for MySQL where all the content is hosted.
Now, to increase the performance even
further is where you can use the Redis cache.
This caches the database request that come to
Azure Database for MySQL and especially if it is
a very read-heavy and less write-heavy application then it can
reduce the computational overhead on
the Azure Database for MySQL and increase the performance heavily.
Finally, you can use Azure Monitor to monitor your app service,
your database, and Redis cache, their performance issues or
any other issues, and figure out a way to resolve them.
Next, let's look at a few best practices
that you can follow to make
sure that your applications are performant as well as secure.
In this example, let's take two applications
talking to two databases in a MySQL Flexible Server.
The first best practice is to make sure that
all your dependent services are co-located in the same region.
Now, this reduces network latency by
a huge amount and increases your performance.
Next, especially if your application is read-heavy,
there is a chance that max connections for your database gets hit.
There is a need to reuse these connections by
using something like a connection bullet.
The third and one of the most important ones is to make sure
that your front-end application service is correctly sized.
The compute power, the memory needed should be
sufficient for the application to run smoothly.
You can size it right by doing load testing and
trying out a combination of compute and memory.
Next is security.
Make sure that SSL is enabled for
all your database communications and on top of
that you can add another layer of
isolation by putting all your resources in a VNet.
In that case, outside resources will not
be able to access what is inside this VNet.
When your application is running on the Cloud,
there is a high chance of networking blips that can happen.
So it's important to implement
retry logic so that whenever there is
a transient networking failure the application can try again
to establish a successful connection.
This way, you can also understand if any error is just because of
a networking blip or
because there is actually an issue underneath.
The last one, make sure that you choose
the right compute and storage for the database server.
Again, perform a bunch of load testing,
try out a combination of compute and storage to make
sure that the database server can host all the databases.
Here are a few resources that you can refer to.
They are also provided in the description below.
Thank you and see you in the next episode.
[MUSIC]