Book Image

Learning Phalcon PHP

Book Image

Learning Phalcon PHP

Overview of this book

Table of Contents (17 chapters)
Learning Phalcon PHP
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Implementing MongoDB


In this section, we will implement a simple log for articles. Of course, you can have your entire website running on Mongo. It is incredibly fast, but personally, I don't like to use it for big projects because Mongo can be very greedy with space. In order to get an overall idea, in the past, I had to index prices for nearly 5,000 properties (apartments, villas, and houses) for 4 years and the size requirement was approximately 50 GB. At my current workplace, we have migrated SMS logs to Mongo and we have nearly 3 million SMS logs for about 20 GB of space. For a relatively small website, MongoDB is perfect, or if you know that space won't be an issue, just go for it.

We will not cover Mongo in this section, but there will an example that shows how to implement it using Phalcon. If you have no idea about Mongo, spare some time and read the basics at http://docs.mongodb.org/manual/.

That being said, let's start implementing the logs. What are we going to log? Article IDs...