Redis®* is an open source in-memory database used by companies around the world—for everything from caching to queuing. Because of its speed and ease of use, Redis® is a personal favorite solution of mine for dealing with large key-value datasets.
In the past, I've used Redis® to speed up costly ranking queries that were ill-suited to a more traditional relational database. I also often use it to manage auto-expiring caches and FI/FO queue systems within many of the projects I find myself working on.
In this post, I demonstrate how to run Redis® on Alibaba Cloud using the ApsaraDB service for high-performance database applications.
Alibaba Cloud Console
As a result of the popularity of Redis®, it's no surprise that Alibaba Cloud has a great solution for spinning up affordable, highly available instances with minimal overhead and next to no effort. To get started with Redis® on Alibaba Cloud, first head to the Alibaba Cloud console and click on the Tair (Redis® OSS-Compatible) button within Products & Services:
Tair (Redis® OSS-Compatible) Instance List
Next, we'll have to actually create a Redis® instance to connect to. To do this, click on the Create Instance button within the Tair (Redis® OSS-Compatible) Instance List. It is important to note that, while the instance list is scoped to a specific region (Virginia, Silicon Valley, etc), you will have the opportunity to select a different region while creating a new instance.
Tair (Redis® OSS-Compatible) Configuration
That button will take us to the ApsaraDB order form, which will allow us to select the desired Redis® configuration prior to deployment. Tair (Redis® OSS-Compatible) configuration falls into four main sections: Basic Configuration, Network, Password, and Quantity.
The Basic Configuration section is where you select the type of Redis® instance you would like to deploy, and the region and zone to deploy it in.
The Network section gives you the opportunity to define which network to run your instance on. At a high level, services running on the Classic Network are not isolated, which means that access can only be blocked by the security group or whitelist policy of the service. On the flip side, the VPC (Virtual Private Cloud) network allows you to build an isolated network environment by providing the ability to customize the route table, IP address range, and gateway within the VPC. Be aware that, while you can convert a classic network instance to a VPC instance, you cannot convert a VPC instance to a classic network instance.
Reset Tair (Redis® OSS-Compatible) Password
The Password section allows you to set the password of your Redis® instance before, or after checkout. While I personally recommend setting the password before checkout, if you decide to set it later, you will have to click on the Modify Password button within the instance information panel, and then proceed to reset the password.
Like Basic Configuration, Quantity is a pretty self-explanatory section. If you need to spin up more than one distinct instance, you can purchase up to 10.
Tair (Redis® OSS-Compatible) Instance List
Once you've purchased your Redis® instance, it's time to get connected to it. To do this, head back to the Tair (Redis® OSS-Compatible) Instance List and click on the region that you purchased your instance for. You should see a new instance under the region that you chose during checkout. Clicking on the name of the instance will take you to the Instance Information panel, which is where we can find information such as the connection address, port number, zone, and other configuration options.
Tair (Redis® OSS-Compatible) Instance Information
Before we can connect to our instance, however, we first need to set up our whitelist. Tair (Redis® OSS-Compatible) only allows connections from within the Alibaba Cloud intranet, which means that only Redis® clients on ECS instances within the Alibaba Cloud network can connect to the service. Regardless, by default, connections to Tair (Redis® OSS-Compatible) are limited to localhost access only, so to open this up to our own applications, we need to whitelist some IP addresses. To do this, open the Whitelist Settings panel found near Instance Information, and add any IP addresses or IP ranges to the list.
Tair (Redis® OSS-Compatible) Whitelist Settings
After access is opened to the appropriate IP addresses, you can test the connection by logging into any ECS instance within the same network and connecting via the redis-cli command line tool:
Testing Redis® Connection
While this is just a simple demonstration, it shows just how easy it is to get started with Tair (Redis® OSS-Compatible) in Alibaba Cloud. Because of the security policies that are used to protect your Redis® instances from the outside world, hosting your entire application infrastructure on Alibaba Cloud will give you the advantage of ease-of-use, combined with advanced configuration ability.
Zachary Flower (@zachflower) is a Fixate IO Contributor and lead developer at Emerson Stone, a Boulder-based design and branding agency. He has an eye for simplicity and usability, and strives to build products with both the end user and business goals in mind. From building projects for the NSA to creating features for companies like Name.com and Buffer, Zach has always taken a strong stand against needlessly reinventing the wheel, often advocating for the use of well established third-party and open source services and solutions to improve the efficiency and reliability of a development project.
*Redis is a registered trademark of Redis Ltd. Any rights therein are reserved to Redis Ltd. Any use by Alibaba Cloud is for referential purposes only and does not indicate any sponsorship, endorsement or affiliation between Redis and Alibaba Cloud.
2,599 posts | 764 followers
FollowAlibaba Clouder - January 21, 2021
OpenAnolis - March 7, 2022
Alibaba Container Service - December 19, 2024
Alibaba Clouder - January 8, 2018
ApsaraDB - October 12, 2020
Alibaba Clouder - April 17, 2018
2,599 posts | 764 followers
FollowA key value database service that offers in-memory caching and high-speed access to applications hosted on the cloud
Learn MoreApsaraDB Dedicated Cluster provided by Alibaba Cloud is a dedicated service for managing databases on the cloud.
Learn MoreApsaraDB RDS for MariaDB supports multiple storage engines, including MySQL InnoDB to meet different user requirements.
Learn MoreA secure, reliable, and elastically scalable cloud database service for automatic monitoring, backup, and recovery by time point
Learn MoreMore Posts by Alibaba Clouder
Raja_KT March 6, 2019 at 4:18 am
Nice sharing. We should mind the gap in whitelisting :)