What database can you recomend for such case:
- Very lot of inserts and updates
- Sophisticated queries (SQL or something like it)
- Lot of data, but small amount of frequently accessed (can be in memory)
- It’s OK to loose part of data (recent hour for example) in case of crash (but not everything)
Possible solutions and problems with it:
- Redis – looks good, but it doesn’t support complex queries.
- RDBMS (current solution) – guarantee ACID and use hard disc a lot so updates is too slow
- RDBMS + RAM disc – will use OS swap, recovery problems, and in general look not very reliable
- MongoDB – has server level lock on writes, is it really fast?
Optional asynchronous writes in mongo will help with speed here. Speed of insert/write in mongodb will faster than sql because mongo write all data in memory first and mongodb does not use transactions.
If you have a lot of hard reports that require join almost all data better use sql here. But if you need hard queries inside of document use mongodb(depend from sql/nosql db schema design)
If enough free memory on the server mongodb load all data into RAM.
Because of i mongodb fanatic i will choose MongoDb, but without specific task cann’t be sure that choose will be right.
Also i’ve compared only sql and mongodb, because i am not used Redis at all.