Simple mongodb collection which stores sent emails:
{
msgid: objectid
senderid: <some objectid>,
sendername: <some name>,
recip: [{memid:<objectid>, name:<some name>}, {memid:<objectid>, name:<some name>}, ...]
}
contains information about message sender and recipients. Now, I’m trying to decide whether I should store sender/recipients names in the message or resolve them after I retrieve messages. By “resolve” I mean look for names by id in memcached cache of the main system. There might be 1-10 recipients per message, and I retrieve 10-20 messages per request, so in teh worst case scenarion I would need to lookup 200 names per page request. The site will be high load, so I’m concerned about the load on memcached, but on the other side storing names along with teh messages will increase disk space used dramatically.
Any suggestion is highly appreciated!
Don’t care about disk space — disk space is nothing, it is cheap.
If your system will highload store at
recipeverything you need (even mother, father names ;)), no doubt.I doing in way described above in my projects and everything working fast ;). But it’s only my opinion and my solution. Other peoples may think different.