Use Redis in C # to learn a Windows installation Redis server side and client

Source: Internet
Author: User
Tags install redis redis server

Learning background

Today is January 2, 2015, the New Year has just begun the next day, I wish everyone Happy New Year's Eve (late blessing bar ^_^). I've been writing the jquery Plugin development series for a while, and this series of articles has been suspended for a while, and I've been looking at Redis for a while, and I'm going to write about My learning history as a series of Redis. Right now the project is using Redis, in the spirit of learning to explore, ready to write my knowledge of a redis learning process and my own a little sentiment. In the course of learning also took a lot of detours, hoping to see this blog post of friends to bring a little help. It's the biggest goal of writing this blog.

I didn't touch any nosql ideas before I met Redis. The knowledge of NoSQL is limited to hearsay, and I am foggy. At that time, I did not think that the existing storage methods have been able to meet the "all" needs, without the use of those "so-called" new products. Here, I am ashamed of the ignorance of the time. Therefore, to believe in the existence of the physical means that there is a reason for its existence and needs. And for the program apes, NoSQL is so good.

Some knowledge can be understood not by listening to others, or by reading one or two articles. Because the things you look at or the knowledge you use in your project may be "chewed" by others, they are not knowledge of the original ecology. If you want to have an in-depth understanding of this knowledge, you must start from scratch and build your own knowledge base at 1.1 points. In that way, knowledge belongs to you. Here is my introduction to Redis cognition.

About Redis

  Redis is an open source API that is written in ANSI C, supports the web, can be persisted in memory, key-value databases, and provides multiple languages. From March 15, 2010 onwards, the development work of Redis is hosted by VMware.

Definition: Redis is a key-value storage system. Like memcached,Redis does not only support simple k/v-type data, but also provides storage such as list (linked list), set (set), Zset (sorted set-ordered set), and hash (hash type). it supports storing more value types. These data types support Push/pop, Add/remove, and intersection-set and difference sets, and richer operations, and these operations are atomic. Based on this, Redis supports sorting in a variety of different ways. As with memcached, data is cached in memory to ensure efficiency. The difference is that Redis periodically writes the updated data to disk or writes the modified operation to the appended record file, and Master-slave (Master-Slave) synchronization is implemented on this basis. (from Baidu Encyclopedia)

Here I will not introduce the difference between the two, the following article I would make up. Now many large enterprise projects are also using Redis for cache processing, such as Sina Weibo, Github, StackOverflow and so on. Redis's official website is http://redis.io/.

the operation of the Redis command a lot of many, I do not introduce each, provide a learning site http://www.redis.cn/documentation.html, interested friends can see.

Installing the Redis server side and client

Download and install Redis first. Through the https://github.com/mythz/redis-windows here can be downloaded directly, and then unzip, and then extract the following files:

1.1 Brief introduction of the following part of the file:

redis-server.exe: Service Program redis-check-dump.exe: Local Database Check redis-check-aof.exe: update log Check redis-benchmark.exe: Performance test to simulate the simultaneous sending of M-Sets/gets queries by n clients (similar to the Apache AB tool). Redis-cli.exe: After the server is turned on, our clients can enter various commands to test

1.2 Turning on Redis servers and clients

1.2.1 Open the cmd command first, select the directory to Redis-server.exe, run Redis-server.exe redis.conf (this opens the Redis server, such as:), the red zone accepted 127.0.0.1:11796 indicates that a client is connected to the Redis server.

1.2.2 Reopen a CMD window, use the CD command to switch to the specified directory, run redis-cli.exe-h 127.0.0.1-p 6379, where 127.0.0.1 is local ip,6379 is the default port on the Redis server. And I also make a test data, look at the red underlined city. (This opens the client)

The client and server side of Redis is basically complete. You can test a variety of commands through the client ^_^. Of course, we can't just be content with this, our goal is to achieve in. Complete the operation of Redis in NET4.5. Next I'll explain how Redis is. The use of the. Net. There are several places to note oh, believe in using. NET4.0 and. NET4.5 's colleagues have all the problems they have encountered. See the next blog post for details.

1.3 Installing the Windows Redis Service

The above is through the cmd command to install Redis server, in fact, you can directly download an installation software Redis-2.4.6-setup-64-bit.exe (I am a 64-bit operating system), a lot of versions, according to their own needs to download. Follow the steps to install it. Very simple. is the Windows Redis service that is installed. Open. ^_^

Redis Installation Summary

The Redis installation is such a bit of content, it should be noted that in the use of the Redis server must always be running (so it is best to make Windows services, haha). For the familiar cmd command is very simple, will not, Baidu is also very simple. The early stages of redis development are ready, and the next article is about. NET4.5 uses Redis, and there are some areas to be aware of. Then slowly.

The core of Redis is profound, and I have a lot of things to study. I hope the gods will be very willing to enlighten them. At the same time also hope and I like, in the study on the road colleagues, have good ideas or information to share with the younger brother, we explore the study together. My QQ Contact:296319075 at any time to contact, notes Annotated Park friends on the good. We are adhering to the common discussion and common progress! If there is reprint, please indicate the source, thank you! ^_^

Also, if you do not want to download the Redis installation package, you can say, I will put myself in the net disk or through QQ and other means to send you the need.

Use Redis in C # to learn a Windows installation Redis server side and client

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.