samedi 20 décembre 2014

Best approach for data storage in custom web app


I'm designing a system with clients where I have following data structure:


users table: user,pass,name,address,phone,email,creditcard,verificationcode,ispro,istrial,regdate,etc.


session table: sessionid,uid,sessiondata


dataentries: each user will be able to create as much as folder they want. each folder can have any amount of entry. each entry will have several key=value entries.


User will always during the day, update/retrieve/delete/create entries mostly, new folder creation might happen once a month. Users will be always retrieving from current folder entries and then click on entry to get list of key=value pairs. Client app will process key=value data and entries etc.


For searching, user might ONLY need to search folder names or entry names, nothing ever will be searched by user in key=value data. So for indexing and searchability, I only need foldernames and "entry name"s only.


Foldername and entry name both would never be larger than 200 chars.


Key=value data size could vary, minimum will be 1kb, maximum would be 20kb.


Session table will be queried so often for EVERY access by user, so I'm planning to run sessions on Redis.


Users table will be queried when user wants to pay bill, change password, forgot password, initial login (session will be set for a year after successfull login, unless user logs out). So I think MySQL would do the job for this.


For data table I have no idea what's good, DynamoDB, MySQL, storing data in a file on SSD drive and only storing relative filename in table and reading/writing/updating file on each relative query, using cassandra?


I want to have best option for 1M active users with at least 200k-300k every second live users. So I need to consider performance and a reasonable cost. I don't prefer managing servers myself like creating casssandra nodes myself and managing them myself and trying to find failed node, etc. But if you think that's best option, I'll consider it.


What do you think?





Aucun commentaire:

Enregistrer un commentaire