当前位置:网站首页>Quickly use Amazon memorydb and build your own redis memory database
Quickly use Amazon memorydb and build your own redis memory database
2022-07-05 06:11:00 【Langya Technology】
Preface
Speaking of cloud vendors , Your first reaction may be Alibaba cloud 、 Hua Wei Yun 、 Tencent, cloud, etc. , Alibaba cloud has the largest market share in China , But the global market share of Cloud Computing , Amazon is the big brother :
At present, Amazon cloud technology provides 100 Of more than products Free package . among , Computing resources Amazon EC2 First year 12 It's free for three months ,750 Hours / month ; Storage resources Amazon S3 First year 12 It's free for three months ,5GB Standard storage capacity ; Database resources Amazon RDS First year 12 It's free for three months ,750 Hours ;Amazon Dynamo DB 25GB Storage capacity is permanently free, etc .
It has Three different types of free offers To choose from :
Free trial
The short-term free trial offer is calculated from the date you activate a specific service12 It's free for three months
Since initial registration AWS From 12 Use these products for free within monthsFree forever
These free package products will not expire , And applicable to all AWS Customer
There's no formula , Pure is white whoring ,AWS Free package , White whoring entrance
This article will be Amazon MemoryDB For example , Describe how to start from scratch and build your own Redis In-memory database .
MemoryDB advantage
Build a traditional self built Redis, Performance needs to be considered 、 Data persistence 、 Extensibility 、 A series of building environments such as firewalls , The steps are cumbersome , laborious . Build through cloud database Redis, from efficiency 、 performance 、 Data security 、 Extensibility And so on , It solves the pain points of traditional methods , Save a lot of time and operation and maintenance costs . Such as :
adopt Redis Fast build
By being Stack Overflow named “ The most popular ” The database of Redis To quickly build applications . Use flexible Redis Data structure and API( for example , Streaming 、 Lists and collections ).
Achieve ultra fast performance
Access data with microsecond read latency and single digit millisecond write latency and high throughput .MemoryDB It can handle more than... Every day 13 Trillions of requests , And supports more than per second 1.6 The peak of billion requests .
Store data with persistence and high availability
MemoryDB Store data in memory , And use the transaction log of multiple availability zones to realize rapid database recovery and restart , Without losing data . because MemoryDB Data can be stored persistently , So you can use it as the primary database .
Easily expand
MemoryDB The storage space of each cluster can be changed from several GB Seamless expansion to 100 TB above , To meet your application needs .
Registered account
No, AWS Account partners need to register their accounts first : Registration and trial address ( On the bill registration page, you can use Domestic credit cards )
Log in to the console
Enter your email address and password
When you come in Service There's so much content , For convenience , We can search here like the following figure MemoryDB, Select the first option for search results
You can see the overall interface , Click... To start using :
MemoryDB Hands on Tutorial
Amazon MemoryDB for Redis It's a And Redis compatible 、 A very persistent in memory database service , Ultra fast performance . Provide submillisecond latency for modern applications with a microservice architecture 、 High throughput and multi availability persistence .
Official documents :https://docs.aws.amazon.com/zh_cn/memorydb/latest/devguide/getting-started.html
Create clusters
Select cluster... In the left navigation pane , And then click Create clusters
Cluster information
Enter the name of the cluster name 、 Description information
Subnet group
Create a new subnet Group , Or select an existing subnet group to apply to this cluster from the available list . A subnet is similar to a local area network
Cluster settings
Use t4g.small example ,2 Free within months ( Provide free instances and... Every month 20GB data )
- Apply to Redis Version compatibility in , Accept the default value
6.2
- Apply to port , Accept the default Redis port 6379
- Apply to Parameter group in , Accept
default.memorydb-redis6
Parameter group
- Apply to Redis Version compatibility in , Accept the default value
Security
Security group - act as A firewall To control network access to the cluster , Very important !!!
Static encryption – Enable encryption for data stored on disk
After setting , Finally, click create
When your cluster status is available when , To whom EC2 Access right , Connect to the cluster and start using it .
Grant access to
establish EC2 example
This section assumes that you are already familiar with Amazon EC2 Instance startup and connection . For more information , see also Amazon EC2 Getting started .
Key pair ( Sign in ) Information , Never choose 【 Continue without a key pair 】 The option to , Otherwise, it will lead to EC2 After the instance is created, it cannot be accessed directly
Authorized access
adopt Security group Configure authorized access .
all MemoryDB The purpose of clustering is to Amazon EC2 Instance to access . The most common situation is from the same Amazon Virtual Private Cloud (Amazon VPC) Medium Amazon EC2 Instance access MemoryDB colony . You have to authorize EC2 Instance access cluster , Then you can start from EC2 The instance is connected to the cluster .
Here's a demonstration , Configure full inbound access directly ,0.0.0.0/0 That is, all devices can access
Connect clusters
From you to MemoryDB Access data in nodes , You can use the secure socket layer (SSL) The client of , It can also be in Amazon Linux 2 Use on with TLS/SSL Of redis-cli.
If you want to use redis-cli Connect to Amazon Linux 2 Upper MemoryDB colony , Steps are as follows :
Sign in EC2 Command line console
choice EC2 Instance Connect Connection type
Download and compile redis-cli Utilities
stay EC2 Instance at the command prompt , Type the following command
#Amazon Linux 2 $ sudo yum -y install openssl-devel gcc $ wget http://download.redis.io/redis-stable.tar.gz $ tar xvzf redis-stable.tar.gz $ cd redis-stable $ make distclean $ make redis-cli BUILD_TLS=yes $ sudo install -m 755 src/redis-cli /usr/local/bin/
stay EC2 Instance at the command prompt , Type the following command , And replace the corresponding content shown in this example with the terminal node of your cluster and port
# Example
# src/redis-cli -c -h Cluster Endpoint --tls -p 6379
$ src/redis-cli -c -h clustercfg.redis-free.uyejvs.memorydb.ap-southeast-1.amazonaws.com --tls -p 6379
among Cluster Endpoint be located MemoryDB Cluster information Cluster endpoint
The actual operation results are as follows :
be limited to Redis command
To provide a hosted service experience ,MemoryDB Restricted access to certain commands that require advanced privileges . The following commands are not available :
acl deluser
acl load
acl save
acl setuser
bgrewriteaof
bgsave
cluster addslot
cluster delslot
cluster setslot
config
debug
migrate
module
psync
replicaof
save
shutdown
slaveof
sync
summary
MemoryDB And Redis compatible , Is a very popular open source data storage , Enables you to use the same flexible and friendly Redis data structure 、API And commands to quickly build applications . Use MemoryDB, All your data is stored in memory , This enables you to achieve microsecond read and write latency per millisecond and high throughput .MemoryDB It also uses multi zone transaction logs to span multiple zones (AZ) Persistent storage of data , For fast failover 、 Database recovery and node restart .
Memory DB Both in memory performance and multi availability persistence , High performance master database for microservice applications , This eliminates the need to manage cache and persistent databases separately .
Amazon cloud technology has also created a variety of learning platforms for developers :
Getting started Resource Center : from 0 To 1 Easy to get started with cloud services , Content covered : Cost management , Start training , Development resources : Point me to visit
Architecture Center : Amazon cloud Technology Architecture Center provides cloud platform reference architecture chart 、 Reviewed architectural solutions 、Well-Architected Best practices 、 Pattern 、 Icon, etc : Point me to visit
Builder Library : Learn how Amazon cloud builds and operates software : Point me to visit
Toolkit for developing and managing applications on Amazon cloud technology platform : Point me to visit
边栏推荐
- 剑指 Offer II 058:日程表
- Dynamic planning solution ideas and summary (30000 words)
- 【实战技能】如何做好技术培训?
- How to adjust bugs in general projects ----- take you through the whole process by hand
- Appium foundation - use the first demo of appium
- Navicat连接Oracle数据库报错ORA-28547或ORA-03135
- [jailhouse article] look mum, no VM exits
- [article de jailhouse] jailhouse hypervisor
- The connection and solution between the shortest Hamilton path and the traveling salesman problem
- [rust notes] 17 concurrent (Part 1)
猜你喜欢
Leetcode-6111: spiral matrix IV
从Dijkstra的图灵奖演讲论科技创业者特点
Smart construction site "hydropower energy consumption online monitoring system"
6. Logistic model
Wazuh開源主機安全解决方案的簡介與使用體驗
Introduction to LVS [unfinished (semi-finished products)]
R language [import and export of dataset]
QQ电脑版取消转义符输入表情
【Jailhouse 文章】Jailhouse Hypervisor
Navicat连接Oracle数据库报错ORA-28547或ORA-03135
随机推荐
Sqlmap tutorial (1)
Solution to game 10 of the personal field
2022 极术通讯-Arm 虚拟硬件加速物联网软件开发
R language [import and export of dataset]
Appium自动化测试基础 — Appium测试环境搭建总结
On the characteristics of technology entrepreneurs from Dijkstra's Turing Award speech
Convolution neural network -- convolution layer
Smart construction site "hydropower energy consumption online monitoring system"
Brief introduction to tcp/ip protocol stack
Spark中groupByKey() 和 reduceByKey() 和combineByKey()
API related to TCP connection
leetcode-3:无重复字符的最长子串
Is it impossible for lamda to wake up?
[practical skills] how to do a good job in technical training?
SQLMAP使用教程(一)
leetcode-6109:知道秘密的人数
智慧工地“水电能耗在线监测系统”
[practical skills] technical management of managers with non-technical background
7. Processing the input of multidimensional features
【Jailhouse 文章】Jailhouse Hypervisor