Skip to content

Commit 07fa8b8

Browse files
committed
jtoland updates
1 parent acbd7ed commit 07fa8b8

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

articles/mysql/flexible-server/tutorial-add-redis-to-mysql.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ ms.subservice: flexible-server
66
ms.topic: quickstart
77
author: mksuni
88
ms.author: sumuth
9-
ms.date: 08/15/2022
9+
ms.date: 12/07/2022
1010
---
1111

12-
# Tutorial: Boost performance of Azure Database for MySQL - Flexible Server with Azure cache for Redis
12+
# Tutorial: Boost performance of Azure Database for MySQL flexible Server with Azure cache for Redis
1313

1414
[!INCLUDE[applies-to-mysql-flexible-server](../includes/applies-to-mysql-flexible-server.md)]
1515

16-
This article demonstrates how to boost the performance of an Azure Database for MySQL using [Azure cache for Redis](../../azure-cache-for-redis/cache-overview.md). Azure cache for Redis is a secure data cache and messaging broker that provides high throughput and low-latency access to data for applications.
16+
This article demonstrates how to boost the performance of an Azure Database for MySQL flexible server using [Azure cache for Redis](../../azure-cache-for-redis/cache-overview.md). Azure cache for Redis is a secure data cache and messaging broker that provides high throughput and low-latency access to data for applications.
1717

1818
## Prerequisites
1919

@@ -23,7 +23,7 @@ For this quickstart you need:
2323

2424
[!INCLUDE [flexible-server-free-trial-note](../includes/flexible-server-free-trial-note.md)]
2525
- Create an Azure Database for MySQL Flexible server using [Azure portal](./quickstart-create-server-portal.md) <br/> or [Azure CLI](./quickstart-create-server-cli.md) if you don't have one.
26-
- Configure networking setting of Azure Database for MySQL Flexible server to make sure your IP has access to it. If you're using Azure App Service or Azure Kubernetes service, enable **Allow public access from any Azure service within Azure to this server** setting in the Azure portal.
26+
- Configure networking settings of Azure Database for MySQL flexible server to make sure your IP has access to it. If you're using Azure App Service or Azure Kubernetes service, enable **Allow public access from any Azure service within Azure to this server** setting in the Azure portal.
2727

2828
[Having issues? Let us know](https://github.com/MicrosoftDocs/azure-docs/issues)
2929

@@ -50,15 +50,18 @@ INSERT INTO tasks (id,title, completed) VALUES
5050

5151
```
5252

53-
## Create a Redis cache
53+
## Create a Redis cache
54+
5455
[!INCLUDE [redis-cache-create](../../azure-cache-for-redis/includes/redis-cache-create.md)]
5556

56-
## Caching result of query using Python
57-
Install the latest version of [Python](https://www.python.org/) on your local environment or on Azure virtual machine or Azure App Service. Use pip to install redis-py.
57+
## Caching result of query using Python
58+
59+
Install the latest version of [Python](https://www.python.org/) on your local environment or on an Azure virtual machine or Azure App Service. Use pip to install redis-py.
5860

5961
```python
6062
pip install redis
6163
```
64+
6265
The following code creates a connection to Redis using redis-py, stores the query result into the redis cache and fetch the value from the cache.
6366

6467
```python
@@ -92,7 +95,9 @@ mysqlcnx.close()
9295
```
9396

9497
## Using Redis with PHP
98+
9599
Install [PHP](https://www.php.net/manual/en/install.php) on your local environment. Follow the steps below to write a PHP script that caches a SQL query from MySQL database. Here are a few pre-requisites before running the script:
100+
96101
1. Install and enable [Redis PECL extension](https://pecl.php.net/package/redis) to use Redis with your PHP script. See [how to install the extension locally](https://github.com/phpredis/phpredis/blob/develop/INSTALL.md)
97102
2. Install and enable [MySQL PDO extension](https://www.php.net/manual/en/ref.pdo-mysql.php)
98103

@@ -137,7 +142,7 @@ print_r($tasks);
137142
```
138143

139144
## Using Redis with WordPress
140-
145+
141146
The benefit of enabling Redis Cache to your WordPress application will allow you to deliver content faster since all of the WordPress content is stored in the database. You can cache content that is mostly read only from WordPress database to make the query lookups faster. You can use either of these plugins to setup Redis. Install and enable [Redis PECL extension](https://pecl.php.net/package/redis). See [how to install the extension locally](https://github.com/phpredis/phpredis/blob/develop/INSTALL.md) or [how to install the extension in Azure App Service](../../app-service/configure-language-php.md).
142147

143148
1. [Redis Object cache](https://wordpress.org/plugins/redis-cache/): Install and activate this plugin. Now update the wp-config.php file right above the statement */* That's all, stop editing! Happy blogging. */**
@@ -162,10 +167,11 @@ define( 'WP_REDIS_MAXTTL', 60 * 60 * 24 * 7 );
162167
/* That's all, stop editing! Happy blogging. */
163168

164169
```
165-
Go to wordpress admin dashboard and select the Redis settings page on the menu. Now select **enable Object Cache**. Plugin will read the redis server information from wp-config.php file.
166170

167-
You may also use [W3 Total cache](https://wordpress.org/plugins/w3-total-cache/) to configure Redis cache on your WordPress app. You can evaluate the performance improvements using [Query Monitor plugin](https://wordpress.org/plugins/query-monitor/) which allows you to debug database queries and it also shows total database queries grouped by a plugin.
168-
171+
Go to the Wordpress admin dashboard and select the Redis settings page on the menu. Now select **enable Object Cache**. Plugin will read the redis server information from wp-config.php file.
172+
173+
You may also use [W3 Total cache](https://wordpress.org/plugins/w3-total-cache/) to configure Redis cache on your WordPress app. You can evaluate the performance improvements using [Query Monitor plugin](https://wordpress.org/plugins/query-monitor/), which allows you to debug database queries and it also shows total database queries grouped by a plugin.
174+
169175
## Next steps
170176

171177
In this quickstart, you learned how to create an instance of Azure Cache for Redis and use it with Azure database for MySQL. See [performance best practices](../single-server/concept-performance-best-practices.md) for Azure database for MySQL.

0 commit comments

Comments
 (0)