>> My name is Sunitha Muthukrishna.
I'm a Program Manager of Microsoft.
Today I'm going to talk to you about how to optimize costs
using Azure Kubernetes Services and Azure Database for PostgreSQL.
Moving to the Cloud is not just a strategy to
modernize your application or your infrastructure,
but also gives you increased
flexibility that helps you with your wallet.
Today I'm going to talk about various ways
you can optimize your costs
using Azure Kubernetes Services and Azure Database for PostgreSQL.
There are four core benefits,
but not limited to, that can help you build your Cloud Solutions.
Using these services, you can scale
at ease and reduce your labor costs.
There are four core benefits,
but not limited to,
that can help build your application on Azure and
decrease your labor costs and
management costs for your application and infrastructure.
You can achieve high availability with a 99.9 percent
SLA for both Azure Kubernetes Services
and Azure Database for PostgreSQL.
You can protect applications from data center failures by
using redundancies across various availability zones,
through geo-replication,
routing your traffic across multiple clusters.
For Azure Database, for PostgreSQL,
in addition to the 99.9 percent SLA,
you can also save money by leveraging reserved instances.
You can pre-pay for your compute resources
through reserved instances,
where you can make a commitment on PostgreSQL Server for a
one or a three-year period and get
a significant discount on your compute costs.
You also have flexibility to change your vCore size,
which makes it a lot more easier to
scale up or down based on your needs.
You also get Intelligent
Analytics and Performance Recommendations,
faster in doing application development experience,
leveraging Azure Dev Spaces.
You can integrate with various Kubernetes tools.
You can leverage Azure DevOps, Azure Monitor,
which provide you a lot of features that makes it a lot more
easier to build out and manage your application.
You can gain visibility into
your environment through our telemetry,
log aggregation, container health,
which is accessible through the portal,
as well as through CLI.
Azure Database for PostgreSQL has features like
query insights and performance recommendations.
They provide you intelligent analytics
and next steps to optimize your application.
You can look at the query insights
to see the longest running queries,
what is the wait time that it's taking for each of those queries,
and how it's affecting your server.
The performance recommendations help you analyze your database and
creates customized recommendations which boost your performance.
You can scale with confidence.
Last, the provisioning of capacity without
the need to manage your infrastructure with
the help both event-driven auto-scaling
and triggers for your Kubernetes cluster.
Azure database for PostgreSQL also gives
you a Single Server Postgres Solution,
as well as a Hyperscale solution called Citus.
It is easy to scale up and down
your PostgreSQL Server and with Hyperscale,
you get a self-service scaling to deal with increased load.
The Azure portal makes it easier to add
new worker nodes and increase the vCores of existing nodes.
You also have built-in security and data encryption.
Both services provide advanced identity
and access management using Active Directory.
You can have additional layer of security through dynamic rules,
enforced with the help of Azure policy on your Kubernetes cluster.
Kubernetes also includes security components
such as network policies and secrets.
Azure then adds in components such as
network security groups and also manages
security patches upgrades on your clusters.
You can leverage data encryption
available for you for your PostgreSQL data.
You get data encryption for both data in
transit with SSL and data at rest.
The data, including backups,
are encrypted on your disk,
except for temporary files,
which are created while running your queries.
Advanced Threat Protection for Azure Database
for PostgreSQL detects
anomalous activities indicating
unusual or potential harmful attempts
to access or exploit your databases.
All these features together
help you build your solutions on the Cloud
with an easier way to scale
your costs based on your needs at a given time.
Let's check out the demo.
I'm going to show you a demo of
a few features that help you optimize your costs.
Now, let's go to the Azure portal and click on "Resource Groups."
Now, select your resource group which has the Kubernetes cluster.
Click on your cluster.
Now, there are many ways you can
actually scale your Kubernetes cluster.
Today I'm going to talk about how you can leverage
autoscale, scaling Kubernetes Cluster.
You may need to adjust the number of nodes to keep
up with the changes in your application workload,
let's click on "Node Pools."
Now, this particular cluster allows me to use multiple node pools.
Each node pool has a similar set of configuration.
In this particular cluster, I have two node pools.
You can click on "Add Node Pool" to add
additional node pools based on your application needs.
You can either scale one
or both of your node pools that are listed here.
Let's click on the first one and let's scale the node pool.
This particular node pool is already set at auto-scale.
The cluster Autoscaler watches
for pods in your cluster for resource constraints.
When issues are detected,
the number of nodes in a node pool is either
increased to meet your application demands
and it's regularly checked for lack of
running pods when the number of nodes can then be decreased.
Now let's scale an Azure database for PostgreSQL.
Let's go back to the Resource Group.
I have a PostgreSQL in this resource group.
You can click on the "Pricing tier" and in the pricing tier,
you can scale up or scale down.
You can choose the vCores you need,
all the way up to 64 cores.
You can choose the storage you need.
You can also choose a feature called a storage auto-growth.
This feature automatically grows
your storage for your application workload
without impacting your application.
You can see the price based on your configuration.
As you change the storage,
the vCore configuration, and
the backup retention for your particular server.
You can also choose
geo-redundant recovery or you can use local redundant recovery.
With a few clicks,
you can enable auto scale for
your Kubernetes cluster and with a few clicks,
you can easily scale up or scale down you PostgreSQL Server.
This helps you optimize your costs based
on your workload for your particular application.
Now let's go back to the Resource Group so I can
show you a demo of Azure Advisor,
on Advisor Recommendations, to see
the different recommendations for
all the resources within that resource group.
Now, here you can see that there is
one recommendation with medium impact.
It says right-size underutilized PostgreSQL Server.
Now, this means that the PostgreSQL server that I have has
been configured at a higher compute
and storage than it actually needs.
Now, let's click on this to see the details.
Now, as you can see,
it gives me my PostgreSQL server name and the recommended actions.
Now you can postpone or dismiss these recommendations.
As you can see that the Azure Advisor here
has been able to provide me with actionable,
personalized best practices recommendation.
The Azure Advisor is able to do this by
analyzing a resource configuration and usage telemetry,
and then gives you recommended solutions
to help you optimize for cost,
performance, high availability, and security of your resources.
Now let's see some demos on
intelligent analytics that you can get from a PostgreSQL Server.
Let's go back to a PostgreSQL Server here.
Click on "Query Performance Insight."
Now, for this demo,
I did run some queries a few days ago,
so I'm going to change the time period.
You can see the list of queries here.
Now, it tells you the duration,
the execution time, which database that this was run against.
So you have all the information that you need to analyze
your query and figure out how you want to optimize it.
All of this information is
provided to you on the long running queries.
If you want to change the number of queries you see,
change the number of queries from here under number of queries.
You can also change
the function that you want to use to aggregate your data.
In addition to long running queries,
you can also click on "Wait Statistics" to
see any queries that were timed out.
Let's see in the past week,
what my queries were.
You can see here there was one particular query
in which I was actually dining PgSleep,
and the PgSleep function timed out,
and the PgSleep function forced the query to timeout.
So if you have other qualities in
your application that do timeout,
it would be listed here.
This gives you enough information
to debug and take necessary action.
Another tool available to you is performance recommendations.
Performance recommendations give you
information about two types of recommendations.
One is create an index or drop an index.
It analyzes the queries and calls made to
your database and identifies whether you should have a new index,
and gives you further information, as you can see here.
It also lets you know the impact that it
may have by leveraging that index.
For Drop Index recommendations,
we analyze the performance of
existing indexes and if an index is rarely used or it's redundant,
the analyzer will identify it and list it out as
one of the recommendations within this particular experience.
Now, note, the performance recommendations is only available for
your primary database server and not for the replicas used.
These were some of the ways you can optimize your cost
leveraging Azure Kubernetes Services
and Azure Database with PostgreSQL.