In our time, the incredible popularity of online social networks have. Classmates, VKontakte, Twitter – all of these services are well familiar to you. This article will focus on how to make a social network with their hands. Now you can even find inernet so-called social networking designers. But we will not use them. We create everything from scratch. We first need to decide on the technology used.

Of course, the easiest, architecture design using our single SQL database. But for such large-scale projects, I would not recommend doing it. The fact is that to deal with peak loads we constantly have to expand system. And with such a task SQL database to cope with labor. The increasing popularity for the construction of scalable systems is gaining so-called key-value database.

As a database server, you can choose Redis. In Russian segment of the Internet, as opposed to sites in English, is still little written about the technology as Redis. After reading this article, you can get acquainted with how to install, run and work with the server Redis. First, you need to download the source code Redis c official site where you will be prompted to choose Redis for several operating systems: Linux, Mac OS X, FreeBSD, OpenBSD, etc. To compile Redis enough to unpack the tar.gz package and run Make: tar – xvzf redis-1.0.0.tar.gz cd redis-1.0.0 make now should check whether the server Redis on our computer. By default (no configuration file), the standard configuration. To start the server just run. / Redis-server in our case, when used standard configuration, all messages will be issued on the standard output, ie on the screen and can watch the process. If you plan to use Redis in the industrial system, it is reasonable to use the file configuration Redis.conf, which is included in the distribution. Reading the comments in this file, you will be able to properly configure your system. Then you need to start the server by specifying Redis as the only parameter name configuration file. For example:. / Redis-server redis.conf In order to make sure that the server is actually working correctly, you can use the utility redis-cli, which is also included with the distribution and compiled together with the whole project Redis.