I have simple MongoDB collection and I am using SLIM micro-framework to develop a RESTful mobile back-end. I don’t need to implement an ODM ( Object Document Mapper ) since its very tiny collection and it wont expand in the future, but at the same time, i need to manage the MonogDB connection as we do in Singleton design pattern so I don’t create instances every time I need to query MongoDB.
The question is: Does PECL MongoDB extension provided by PHP manages the connection pooling and handle this issue, or I have to write a Singleton class and totally depend on it to manage the MongoDB instances. thank you.
It does the pooling for you. See http://php.net/mongo.connecting . Sounds like you’ll also want persistent connections.
What’s “single-tone”?