Question: I'm implementing a chat system.

What kind of database I should use for logging chat messages?

I need to do some queries to it. For example "give me all the links from user x between these dates"

I've [heard](http://blog.mongodb.org/post/172254834/mongodb-is-fantastic-for-logging) some good things about MongoDB for this kind of stuff. How about other NoSQL solutions? Redis? Cassandra?

How about old SQL solutions? Although I'm very interested having experiences with NoSQL-databases, but I'm not going to it just sake of it :)

I need to be able to handle hundreds of active users.

Answer: 
Ok. So basically NoSQL is not a panacea. You really have to know the sweet spot for each NoSQL to gain maximum benefit of it. 

For your scenario I would recommend mongodb. Why? Because mongodb offer very rich query just as you would have in SQL database, unlike key-value store database. Mongodb is relatively fast in both write and read.

Unless you need massive scalability like facebook or twitter, cassandra is not for you.
My vote goes out to redis(+node). I can handle that scale easily.