redis

Several Redis databases on the host

Is it possible to host several separate Redis databases on the same host? At least in php drivers there is no possibility to set a specific database. The use of pseudonyms (somewhere on the Internet was such an option) does not roll - overly weak protection. Read more

NoSQL - application features

When is the use of such databases as MongoDB, CouchDB, Redis and some others justified? Does it make sense to put them instead of the classic mysql, on a site with a weak load? Are they used in conjunction with mysql, or work separately? Read more

Replication Redis

I am engaged in one startup in which we use radishes, now the question of building a fault-tolerant database cluster has come close. As is known, radish currently supports only master-slave replication. It is necessary that if a master falls, one of the slaves would take the function of a master. For this purpose, I found the following solution: github.com/fictorial/redis-cluster-monitor. When the master crashes, this monitor selects a new master and sends a synchronization signal with it to t... Read more

How to extract N random non-repeating elements from SET in Redis?

There is a SET c 1000 id, you need to choose 3 random and non-repeating. The decision "in the forehead" - make SRANDMEMBER 3 times, but there is no guarantee that there will be no repetitions. You can - control replays at the client level and cycle the SRANDMEMBER cycle until the received set is unique, but this is also somewhat clumsy. Sort by random value (something in the spirit of SORT ... BY RAND LIMIT 3 INTO ...) Redis does not know how. As a result, SORT ... INTO ... the result... Read more

Can I get the number of a specific string when sorting in MySQL

Example: I have N users with exp from 0 to M. Are users sorted in descending order, from M to 0. Can I get a user number with an id in this list? Now I use REDIS.ZSET for this, but it would be interesting to know the solution on MySQL. Read more

NoSQL and data integrity?

I read carefully about the redis, and am in turmoil. It looks like I don’t understand something, or redis is really worth using only as a cache, autocomplete and other things like that. So, read the documentation: “Snapshotting is not very durable. „ IS NOT VERY! With these words, they prioritize those projects where data integrity is not important. How can this be? Preservation is not important or not critical only in the case of caching or logging something, but they do not position t... Read more

How to open a port in ubuntu-server for local use?

I want to test redis for python. The test falls out with an error: >>> import redis >>> r = redis.Redis(host='localhost', port=6379, db=0) >>> r.set('foo', 'bar') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.6/dist-packages/redis-2.2.4-py2.6.egg/redis/client.py", line 556, in set return self.execute_comman... Read more

NoSQL. Redis. The number of online-people

A question that has been tormenting for a couple of days. There is an application that uses mysql to store information about users and nosql / redis to provide quick write / read information. There are a lot of these procedures (read / write), so radishes have been chosen. Part of the task is completely ported to redis. but there is a question on which I can not yet find a solution. The application should show the number of people "online." If you can update the online field ... Read more

How to cache DataMapper models?

DataMapper is far from a marginal ORM - in practice, puzzled by a decrease in the load on the base. How do you implement model caching? Marshalim the entire facility and memkesh? We tear out the final Hash with the data and in the radish? Or from model to JSON and to files on tmpfs? * Rolled solutions ala cache_money (ActiveRecord) not found. Read more

Redis. How to write to the key TimeStamp from the server where the Redis-server is running?

A simple task, but I never found an answer on the Internet. Records are made to the Redis server from other sites on the Internet using php-rediska. The date set on these sites naturally can not be trusted. Important per second accuracy. Read more

Useful Links