What I've got right now with Mysql
Here is my database:
I search users by location a lot using bounding box.
There are two more tables: user_tag and tags. The overall database size is about 1 Gb.
I've implemented an arbitrary tag system with these tables, so that when user wants to use tag that hasn't been created yet, this tag is inserted in tag table.
I also search users by tags.
Benchmarks
I have no indexes in this database except those on primary keys.
As you can see there are a lot of inserts and they take much time.
Main problem here is time consuming inserts and updates.
Create new Event with tags(~150ms):
Update Event(~200ms):
What I don't like in this solution:
- When I create new user I do insert in 3 tables to link the user with his tags.
- When updating user information I also need to do 3 updates and 1 deletion or insert when user changes tags.
- Searching users by tags gets really messy (complex query) (How to implement tag system)
What can I get with NoSql
I want to use a document oriented database. Then I will need only one collection:
{
"name": "Dan",
"lat": 60
"lon": 30
"tags":["football", "fishing"]
}
I will be able to set index on tags and lat and lon for faster search.
My questions
- Should I switch to NoSql or I can somehow improve my current implementation. Or maybe switch to a different RDBMS?
- In case I should switch: What NoSql database is the best in this case?
- In case I should switch to MongoDb: Is it reliable and mature enough? Because I've read a lot of posts about people going away from MongoDb. For example: http://www.reddit.com/search?q=mongodb