Amazon Cloud Technology re:Invent Conference - ElastiCache Serverless model is coming

Amazon Cloud Technology re:Invent Conference - ElastiCache Serverless model is coming

This article authorizes the official Amazon Cloud Technology article to forward and rewrite the rights, including but not limited to Amazon Cloud Technology official channels such as Amazon Cloud Technology Developer Community, Zhihu, self-media platforms, and third-party developer media.

Conference introduction

Insert image description here

Amazon Cloud Technology’s re:Invent conference is an annual technology event for global technology developers. Almost every time, major product updates are released in cloud technology, cloud computing and other related fields, which not only continuously integrate the current mainstream and popular technologies, but also indicate the direction for future development.
The content not only shows the updates of Amazon Cloud Technology’s own products, but also provides a good reference for learning and development for practitioners in the industry. Looking back on the past ten years, the technology field has developed rapidly, and technology replacement and development model changes have become faster and faster. It is particularly important to understand the development direction of technology as early as possible.
At the re:Invent conference in 2023, major updates to more than ten core products were released at once, including AI, chips, object storage, Serverless, ETL, etc. This article mainly talks about the Amazon ElastiCache data caching service commonly used in work.

一、Amazon ElastiCache

Insert image description here

1. Product introduction

Quote from the official description: Amazon ElastiCache is a fully managed, Redis- and Memcached-compatible service that delivers real-time, cost-optimized performance for modern applications. ElastiCache scales to hundreds of millions of operations per second and maintains microsecond response times while delivering enterprise-grade security and reliability.

When developing applications or platforms with high concurrency and a large number of users, the core business process is built through server-side code and persistent storage. In addition, there should also be a cache layer, which is mainly used to deal with frequent and high-frequency applications. Data query to reduce the pressure on the database. At the same time, various data structures can also be constructed in the cache layer to quickly update various sorted lists, or play a very important role as a transfer layer for data synchronization.

2.Upgrade comparison

According to the content of this official article:
Three-Serverless-Innovations-to-Help-Customers-Analyze-and-Manage-Data-at-Any-Scale makes it faster and simpler to create a highly available cache, and can instantly scale vertically and horizontally according to application needs without the need to manage infrastructure . The new Serverless mode, announced three new serverless innovations designed to help customers scale their data infrastructure more quickly and easily to support the most demanding use cases. Covers the fields of database and analysis, simplifying large-scale data management and analysis operations.
Insert image description here

This article will focus onAmazon ElastiCache Serverless. The new Serverless mode was announced at the end of November, which can simplify cache management and instant expansion. These are all It is a standard feature of Servless. The editor personally feels that this is also the overall development trend of cloud storage, which is constantly encapsulated to achieve out-of-box use and constantly optimized to reduce costs and increase efficiency.

3.Application cases

Insert image description here

  • Lower total cost of ownership

By using the cache layer, the overhead of the data persistence layer is reduced, and more importantly, the user's response time can be effectively optimized. Of course, the prerequisite for implementation is to properly construct query logic and maintain data updates in the cache layer. The application of the cache layer is not only for conversion to faster reading and writing services, but also for the design of relevant reading and writing rules.

  • Real-time application data caching

One of the main reasons why the caching layer is so responsive is to store data in memory, mostly based onKey-Value For the model, you can just take whatever you want. For the user, they only need to care about how to design the Key.

  • Live session storage

Real-time session storage can cover many scenarios. For example, shopping cart data in e-commerce scenarios will not be written to the database directly and persistently. At best, it will be used for delayed storage. Therefore, it is very appropriate to store it in the cache layer before that, including Data related to users who are not logged in can also be stored based on predefined session IDs to save some data.

  • Real-time leaderboard

The real-time ranking list can be said to be one of the classic applications of the cache layer. After all, the characteristic of the ranking list itself is real-time changes. It is unreasonable and inappropriate to use a relational database for support. Structures such as zset in Redis can be well supported. When the data changes, rankings will be automatically performed. Businesses related to the rankings can be combined with Database entities are properly separated.

2. Use experience

Since this update is mainly reflected in the Serverless mode and performance optimization, the editor will take you to experience the entire product here. In the process, I will try my best to interpret the differences with the traditional mode.

1. Free trial

Insert image description here

Amazon ElastiCache Also in New UserFree Tier, click Start using Amazon ElastiCache button to start creation. Click Get Started Here we take Redis as an example:
Insert image description here

2. Create Redis

currently department selection middle selection without service:< /span>
Insert image description here

After defining the name inSettings, checkDefault Settings
Insert image description here

You can see that the default engine version is 7. If you need to change the engine or modify the usage area, you can click Customize the default configuration, and finally Click the Create button.
Insert image description here

3. Contrast with tradition

You can see that this completes the creation of the cache service for the Redis engine. Because it is Servless mode, we do not need to specify detailed configuration. Different from the pay as you go model, in the pay as you go model we still have to choose different hardware configurations and evaluate the overall carrying capacity. , while Serverless can be dynamically deployed. After waiting for the creation to be completed, you can see the status display Available:
Insert image description here

4.Create EC2

Here is a demonstration of the process of passingEC2 connection test. First, we confirm that the available zone isus- east-1, here you can check your own availability zone, and then create an EC2, which is a cloud server, in the corresponding zone, which is also free to use:
Insert image description here

Open the EC2 panel through search, click the Launch instance button, and confirm that the region is correct before creating:
Insert image description here

Fill in the name:
Insert image description here

Select the image with Eligible Free Tier and select Amazon Linux 2< /span>, continue to the next step:
Insert image description here

Point 网络设达编辑
Insert image description here

Configure according to the Amazon ElastiCache network created previously [Important]:
Insert image description here

Click to create a new key pair for local remote connection [in this example, we will connect directly to the cloud]:
Insert image description here

After creation, the key file will be automatically downloaded, just save it.
Insert image description here

The maximum storage space you can use in the free plan is 30GB. If you plan to use this instance for a long time, you can modify it to be larger:
Insert image description here

Finally click the Launch Instance button on the right:
Insert image description here

5.Network configuration

It needs to be explained here that the rule of the security group where Amazon ElastiCache is created by default is to allow access from any address under the same VPC. This is why we created EC2 for access, which can greatly Improve security. Now, we need to open a separate 22 port for this security group so that we can connect to EC2 for operations. First come to the security group settings:
Insert image description here

Click on the security group you want to modify:
Insert image description here
Insert image description here

Add the following rules and save:
Insert image description here

It is particularly emphasized that because the corresponding IP after Amazon ElastiCache is created is not a public IP after resolution, we must use EC2 to access it directly. In actual use, it can also be called through other Amazon cloud products under the same network.

6. Connection test

After EC2 is created, you can see the following interface:
Insert image description here

Or you can click the Connect button on the instance details page:
Insert image description here

You can enter the following interface. Now we can directly connect to the cloud:
Insert image description here

Then enter the following command to install redis-cli:

sudo amazon-linux-extras install epel -y
sudo yum install gcc jemalloc-devel openssl-devel tcl tcl-devel -y
sudo wget http://download.redis.io/redis-stable.tar.gz
sudo tar xvzf redis-stable.tar.gz
cd redis-stable
sudo make BUILD_TLS=yes

Next, get the connection parameters through the endpoint information in Amazon RlastiCache, such as:

# 以小编自己的信息为例
my-redis-jdkpnh.serverless.use1.cache.amazonaws.com:6379
# 拆解后的命令为
redis-cli -h my-redis-jdkpnh.serverless.use1.cache.amazonaws.com --tls -p 6379

Then execute the corresponding command to connect successfully:
Insert image description here

Special attention: Must be added when compilingBUILD_TLS and must be used when connecting –tls can connect successfully!

Conclusion

It can be seen that cloud database storage products are currently developing in the direction ofServerless. In this process, users no longer need to Maintain the storage service itself. For example, before we needed to build a Redis cluster, we needed to manage nodes, evaluate performance, control permissions, etc. Now we only need to manage VPS to control permissions. Many friends are exposed to security groups for the first time. VPC, subnet, etc. are still relatively unknown. In the past, it may have been just a matter of simply opening the port, but now it is very necessary to learn the operation of the entire cloud assets and their relationship with each other.

Supongo que te gusta

Origin blog.csdn.net/u012039040/article/details/135007694
Recomendado
Clasificación