hi.
im wondering to use document-based database such as mongodb or couchdb for my next project.
i searched alot on this subject that what i lose and what i get in distinguish with sql.
things that i look in document-based is:
- i dont want to struggle with complex queries and indexing
- speed as its said its much faster than sql
- extending when there is no basic model for user progress
i need database for these subjects:
- user data and progress
- log( i need to log all important user actions for user support and basic cheat detection)
- report and metrics(arpu,install,paidrated …)
for logging as its big amount of data, i want to know can i simply remote data for example for more than past 2 month or its a heavy task for db like mongo and does all records have the date log on them or i have to handle date on records?
as i used sql for my past project, i had to query complex metrics on database that was supporting users live. for a database with 10 million user records sometimes it toke 10 minutes to calculate paidrate that is a very long time. i know with better indexing and more efficient query it can be much less but as i noticed, sql is all about exprience. these are the reasons that make me to look at document based as an alternative for some one that is not much exprienced database programmer.
i have more questions.
- sql supports stored procedures that are faster than basic queries because they are parsed and planed before. as o looked, mongodb has stored js. use of them for performance is a must or not?
- i know there is no best practice for document-based databases but i know there is 2 typed of recrding. embedded and also flat records with referencing. can you tell me which one is more performant
- can i use document-based as main database with no supporting database?
- i use redis for leaderboard. i joined the redis result with sql to get final leaderboard data. join in sql is faster or finding 100 records in mongo one by one?
- it said that mongo gived indexing hints based on database statistics. are these hints enough for making most performant condition?