Monthly Archives: December 2016

asynchronous iteration & recursion

url https://mostafa-samir.github.io/async-iterative-patterns-pt1/ https://mostafa-samir.github.io/async-recursive-patterns-pt2/

Posted in Design, Uncategorized | Leave a comment

deep populate with mysql

purpose get the sub obj by reading the db can specify the level can specify the field to be populated save the definition in mongodb -> this is kinds of meta data possible requirement just read some field -> select … Continue reading

Posted in DB | Leave a comment

use MySQL or MongoDB?

both has pros mysql good for joint query mongodb good for dynamic schema mongodb as cache mongodb for pictures? use both off load mysql db make some work simple by using the mongodb do not use the weird feature maybe … Continue reading

Posted in Uncategorized | Leave a comment

mongodb – separate document vs. embedded document

no big difference for insert and update So, separate collections are good if you need to select individual documents, need more control over querying, or have huge documents. Embedded documents are good when you want the entire document, the document … Continue reading

Posted in DB | Leave a comment

mongoose schema, model, document

objectId ObjectID (12 bytes HEX string) = Date (4 bytes, a timestamp value representing number of seconds since the Unix epoch) + MAC address (3 bytes) + PID (2 bytes) + Counter (3 bytes) Concept A Schema is an object … Continue reading

Posted in DB | Leave a comment

mongoose connection

is connection pool managed? looks yes, the default pool size is 5, can be modified by the optional parameter or the url parameter difference with the native mongo drive? how to use the connection for some query? use it directly … Continue reading

Posted in DB | Leave a comment

mongodb connection

MongoDB uses a new thread for each new connection. Node’s Mongoose is non-blocking and so you use one connection per app usually stack overflow http://dba.stackexchange.com/questions/37075/overview-of-how-mongodb-uses-its-various-threads In MongoDB, each host can use 10 connections which is set by MongoOptions.connectionsPerHostproperty. These connections … Continue reading

Posted in DB | Leave a comment