PHP and MongoDB Web Development Beginners Guide by Rubayeet Islam Projects-Oriented Book Combine the power of PHP and MongoDB to build dynamic web 2.0 applications Learn to build PHP-powered dynamic web applications using MongoDB as the data backend Handle user sessions, store real-time site analytics, build location-aware web apps, and much more, all using MongoDB and PHP Full of step-by-step instructions and practical examples, along with challenges to test and improve your knowledge In Detail With the rise of Web 2.0, the need for a highly scalable database, capable of storing diverse user-generated content is increasing. MongoDB, an open-source, non-relational database has stepped up to meet this demand and is being used in some of the most popular websites in the world. MongoDB is one of the NoSQL databases which is gaining popularity for developing PHP Web 2.0 applications. PHP and MongoDB Web Development Beginners Guide is a fast-paced, hands-on guide to get started with web application development using PHP and MongoDB. The book follows a Code first, explain later approach, using practical examples in PHP to demonstrate unique features of MongoDB. It does not overwhelm you with information (or starve you of it), but gives you enough to get a solid practical grasp on the concepts. The book starts by introducing the underlying concepts of MongoDB. Each chapter contains practical examples in PHP that teache specific features of the database. The book teaches you to build a blogging application, handle user sessions and authentication, and perform aggregation with MapReduce. You will learn unique MongoDB features and solve interesting problems
like real-time analytics, location-aware web apps etc. You will be guided to use MongoDB alongside MySQL to build a diverse data back-end. With its concise coverage of concepts and numerous practical examples, PHP and MongoDB Web Development Beginners Guide is the right choice for the PHP developer to get started with learning MongoDB. What you will learn from this book Get MongoDB up and running on the machine (Windows/Mac/Linux) Build a PHP-powered website with MongoDB as the data storage Handle HTTP sessions with MongoDB Store website analytics data in real time Process large datasets with MapReduce Use MongoDB to supplement your existing relational database - build data archives, cache tiers, store results of expensive SQL queries in MongoDB Build location-aware web applications Optimize MongoDB for better performance and security Approach The book follows a Code first, explain later approach, using practical examples in PHP to demonstrate unique features of MongoDB. This book is packed with step-by-step instructions and practical examples, along with challenges to test and improve your knowledge. Who this book is written for This book assumes that you are experienced in web application development using PHP, HTML, and CSS. Having working knowledge of using a relational database system such as MySQL will help you grasp some of the concepts quicker, but it is not strictly mandatory. No prior knowledge of MongoDB is required. My Personal Review: Disclaimer: I received the book from Packt Publishing to review it. I tried hard to be objective. General review In a word: excellent. But it can be improved. If I recall correctly, this is the first book about integrating PHP and MongoDB. The writing style is easy and most concepts are clearly explained. Some dark spots remain in the functional programming concepts in the mapreduce dedicated chapter. A deeper explanation could have helped.
Every chapter sports various code examples and quizzes scattered through the books help recalling just-read concepts. Maybe they are a little too few. Solutions to the quizzes are in the appendix. Every chapter also has call to actions (without solutions, naturally) inviting the users to implement solutions based on explained concepts. My preferred part of the books are the examples: the code is presented full and complete, and only after that, you can read the explanation, with snippets taken from it. You can have a full view of the code and analyse it by yourself, or read the description snippet by snippet. Most other technical manuals split the code, or fill it with comments, making it nearly unreadable. The book style appears to shift a little away from classical technical manual, reminding academic books. Sometimes it seems (often rightly) there is much more behind some functionalities and that the book teaches only the basic usage. In some cases it is clearly written (including a link) that you can deepen your understanding reading online articles. Some minor typos, like array fields defined by : (as in javascript) instead of => in PHP code, or missing quotes in array indexes, are easily spotted and dont lower the quality. Chapter 1: installation After a brief introduction to the NoSQL movement explaining its fundamentals, installation on Windows and Linux is described. As for OSX, it simply says it is just like on Linux. Installation is so easy that it takes at most a couple of pages. Next comes server startup, covering base configuration options, and basic database and collections creation. It ends with PHP driver installation (using PEAR) and a little example script. Chapter 2: first application It became the hello world of books covering web techs: you begin building a simple blog, covering insert, delete and alter operations. Then pagination and comments are introduced. It serves its purpouse in introducing CRUD (Create, Read, Update, Delete) operations in MongoDB, covering MongoDB query language, including limit, skip, cursors and safe writing concepts. The chapter ends with some peculiar operations (upserts, field increment, field removal) and the distinction between embedded and referenced
document, also explaining how to do a select operation on embedded documents. Chapter 3: a session manager After a brief introduction, the book delves into creating a custom session handler. A (singleton) class is introduced to manage the connection to the DB, and it will be used throughout the entire book. A class is defined to handle the PHP session using a MongoDB collection. This can easily be reused in own projects, being nearly completely transparent. The chapter ends with a user login/logout example. It is useful to understand how to abstract access to MongoDB through a class, how to use upsert and also to know how to use a generic (even SQL) database to handle sessions. Chapters 4 and 5: aggregation and statistics I cover the two chapters together because they deal with the same topics: map-reduce and group(). Map-reduce is maybe the hardest topic for thos used to procedural or OOP languages, as it embraces function programming concepts. On the other hand, group() is similar to the SQL GROUP BY concept. These chapters arguments are not easy to grasp, and I would have liked more examples. Luckily the given examples are very practical (tag cloud, web access statistics,...) and not abstract aggregations. Capped collections are introduced here. Chapter 6: RDBMS integration This is maybe the least useful chapter, in my opinion, but it could be important to others. Several examples of how to connect to a SQL (MySQL) DB and MongoDB in parallel: how to use MongoDB as a query cache, or to archive old data, so to remove burden from MySQL queries. Chapter 7: GridFS This chapter is a little thin, given the topic, but it gives you everything you need to start working with GridFS to store (binary) files in the database. MongoDB excels in its simplicity, and the examples are short and clear. One of the call to actions asks to implement a thumbnail gallery, saving the thumbnail along with the original image, but does not explain if you can save different files in the same document (hint: you cant). Chapter 8: geolocation This chapter introduces MongoDBs geolocation features: 2D indexes and server-predefined procedures to search distance-based data.
A good introduction, even if it leaves some itches to scratch about measure units (degrees? radians? meters?). Excellent explanation on how to use the data with Google Maps to visualize the results. Chapter 9: security The chapter with fewer PHP code lines in it, focuses on console administration for user (and password) access management. It also covers indexes creation and analysis: this part should have been introduced earlier in the book. Chapter 10: RockMongo and phpmoadmin A quick introduction to two web-based (PHP) interfaces for administration query and, above all, backup and restore of databases and collections. Covers pros and cons of both solutions, as well as installation and basic use. For More 5 Star Customer Reviews and Lowest Price: PHP and MongoDB Web Development Beginners Guide by Rubayeet Islam - 5 Star Customer Reviews and Lowest Price!