News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Derick Rethans:
Introduction to Document Databases with MongoDB
September 06, 2013 @ 09:20:08

If you've been wanting to get into document databases (NoSQL stuff) but haven't had a good beginners guide to look at, Derick Rethans has just the post for you. It introduces some of the concepts behind these databases with just a splash of how to use it in PHP.

By now most you will probably have heard of the term NoSQL. It's a vague term that covers a lot of different types of database engines. The main classes of NoSQL databases are key/value stores, column databases, graph databases and document databases. [...] Apache CouchDB and http://mongodb.org/">MongoDB belong to the last category, Document databases. We will be looking extensively at MongoDB in this article.

He starts off with some explanation of basic terminology and quickly gets into some of the strengths of a document-oriented database. He talks about data models and collection interaction as well as an example query translated from ANSI SQL to the MongoDB format. He has a basic installation and configuration guide, both for MongoDB and installing the PHP driver you'll need to make the connection.

0 comments voice your opinion now!
introduction mongodb document database

Link: http://derickrethans.nl/introduction-to-document-databases.html

PHPMaster.com:
MongoDB Indexing, Part 1
May 06, 2013 @ 11:50:44

New on PHPMaster.com is the first part of their series about indexing in MongoDB, a method for optimizing your collections to make querying them even faster. They cover the five main types of indexes and situations where they can help.

Indexing is one of the more important concepts of working with MongoDB. A proper understanding is critical because indexing can dramatically increase performance and throughput by reducing the number of full documents to be read, thereby increasing the performance of our application. Because indexes can be bit difficult to understand, this two-part series will take a closer look at them.

They look at the default "_id" index, secondary, compound, multikey and multikey compound indexes. Example documents and results are included as well as some of the options that can be set on the index types to tweak performance. They finish up the article with a look at some of the limitations and considerations to think about when using indexing, including that they cannot be used with regex queries.

0 comments voice your opinion now!
mongodb index tutorial example document query series

Link: http://phpmaster.com/mongodb-indexing-1

Bradley Holt:
Entity Relationships in a Document Database at ZendCon 2012 (Video & Slides)
November 19, 2012 @ 10:03:55

If you weren't able to attend this year's ZendCon conference and wanted to see Bradley Holt's talk about entity relationships and document databases, you're in luck - he's posted both the video and slides to his site. Here's his summary of the session:

Unlike relational databases, document databases like CouchDB and MongoDB do not directly support entity relationships. This talk will explore patterns of modeling one-to-many and many-to-many entity relationships in a document database. These patterns include using an embedded JSON array, relating documents using identifiers, using a list of keys, and using relationship documents. This talk will explore how these entity relationship patterns equate to how entities are joined in a relational database. We'll take a look at the relevant differences between document databases and relational databases. For example, document databases do not have tables, each document can have its own schema, there is no built-in concept of relationships between documents, views/indexes are queried directly instead of being used to optimize more generalized queries, a column within a result set can contain a mix of logical data types, and there is typically no support for transactions across document boundaries.

He also includes links to two of the tools he mentions in the talk - Doctrine CouchDB and the Doctrine MongoDB ORM.

0 comments voice your opinion now!
zendcon12 entity relationships document database video slides


PHPMaster.com:
Error Logging with MongoDB and Analog
March 22, 2012 @ 11:11:39

On PHPMaster.com today there's a new tutorial from Lorna Mitchell introducing you to using Analog for error logging in a MongoDb connection. Because of the way the tool (Analog) is designed, it could be used anywhere - she just uses the MongoDB connection as an example because it integrates easily and efficiently.

MongoDB is an excellent fit for logging (and of course other things as well) for many reasons. For one, it is very VERY fast for writing data. It can perform writes asynchronously; your application wont hang because your logging routines are blocked. This allows you to centralize your logs which makes it easier to querying against them to find issues. Also, its query interface is easy to work with and is very flexible. You can query against any of the field names or perform aggregate functions either with map/reduce or MongoDB 2.2's upcoming aggregation framework.

This article will show how you can use existing code to add a logging library to your code and log errors to MongoDB. You'll also see how to query MongoDB from the command line and how to filter those queries to find the information you are interested in.

Analog makes it simple to log information in an easy to use, self-contained, extensible kind of way, offering writers for multiple output formats including: files, the FirePHP plugin output, email, POSTing to another machine and sending to a syslog daemon. She also mentions the different logging levels the tool makes available and how to filter down your logging results based on them (searched by "equal to", "greater than" and grouped by level).

0 comments voice your opinion now!
error logging mongodb analog document database tutorial


PHPMaster.com:
Introduction to MongoDB
October 27, 2011 @ 08:27:47

PHPMaster.com has a new tutorial today for those wanting to get into the MongoDb document-driven (NoSQL) database but haven't known where to start. This tutorial walks you through some of the basics including setup and configuration of both the server and PHP client side.

There are a lot of implementations of the NoSQL concept, but one of the most famous and widely used NoSQL databases is MongoDB. I think it's one of the most interesting NoSQL databases available currently, and it's considered by many to be one of the easiest to use (which has helped it gain widespread adoption). In this article I'll introduce you to NoSQL with MongoDB. You'll learn how to install the MongoDB extension for PHP, and how to add, update, and retrieve document objects.

He starts with an introduction to MongoDB and links to their site to grab the latest version of the database. A few simple steps later (including a call to install the mongo PECL module) and your PHP install is ready to go. Code snippets are included showing how to connect to the server and insert/update/select document records.

0 comments voice your opinion now!
introduction mongodb database document nosql tutorial


Philip Norton's Blog:
Creating A Thumbnail Of A Word Document With PHP And LiveDocx
September 26, 2011 @ 08:50:42

In a new post to his blog Philip Norton shares a method for creating a thumbnail of a Word document with the help of PHP and LiveDocx (in this case, the component inside the Zend Framework).

Creating Word document icons is very simple thanks to a service called LiveDocx. LiveDocx was created as a web service to allow the easy creation of most document formats from a simple template. However, it is possible to send a normal Word document as the template file and get an image of the file in return.

You'll need a LiveDocx account to be able to use the service - there's a free option of their service that uses a shared server. Included in the post is a sample script that defines a LiveDocx connection, pulls in a local Word document for parsing and calls a "getBitmaps" method on the service to return the raw image data. This is pushed into an image (using GD) as a PNG.

0 comments voice your opinion now!
word document livedocx zendframework webservice image thumbnail


DZone.com:
The era of Object-Document Mapping
July 08, 2011 @ 11:45:46

On the PHP on Windows section of DZone.com today Giorgio Sironi has posted about a different sort of object mapping than is usually thought of with databases - object-document mapping.

The Data Mapper pattern is a mechanism for persistence where the application model and the data source have no dependencies between each other. [...] But everytime we talk about the Data Mapper pattern, we assume there is a relational database on the other side of the persistence boundary. We always save objects; we always map them to MySQL or Postgres tables; but it's not mandatory.

He talks about two projects, MongoDb_ODM and CouchDb_ODM, that the Doctrine project is working on to help make working with document-driven databases as simple as the usual ORMs. He includes a brief code snippet showing how the feature will work (hint: a namespace of Document instead of Entity). He lists some of the features - including the usual ORM capabilities, support for collections, cascade of persistence - and where you can get the latest code for it (from github and PEAR

0 comments voice your opinion now!
object document mapping doctrine mongodb couchdb


Zend Developer Zone:
ZendCon Sessions Episode 041 Documents, Documents, Documents
March 07, 2011 @ 08:47:05

On the Zend Developer Zone today they've published the latest episode in their ZendCon Session series (as recorded at ZendCon 2010), a talk from Matthew Weier O'Phinney about document databases - Documents, Documents, Documents.

Welcome to the ZendCon 2010 edition of the ZendCon Sessions. The ZendCon Sessions are live recordings of sessions that have been given at previous Zend Conferences. [...] In this series we will be releasing sessions from ZendCon 2010! This episode of The ZendCon Sessions was recorded live at ZendCon 2010 in Santa Clara, CA and features Matthew Weier O'Phinney giving his talk: "Documents, Documents, Documents"

You can listen in one of a few ways - either via the embedded player on the Devzone site, by grabbing the mp3 itself or by subscribing to their feed to get this and other great episodes.

0 comments voice your opinion now!
podcast zendcon10 matthewweierophinney document database


ServerGrove Blog:
Creating indexes for your Doctrine ODM documents with Symfony 2
October 08, 2010 @ 08:24:41

On the ServerGrove blog there's a new post showing you how to create indexes for your Doctrine ODM documents in a Symfony 2 application.

Creating indexes in NoSQL / Document-based databases is quite different compared to traditional relational databases. Since the former are schema-less (there is no table creation), indexes do not get created when the collection or the document is created or inserted. Here is a quick tip that will create all the indexes defined in your documents when using Symfony 2 and Doctrine ODM for MongoDB. Indexes are a great way to speed up your queries, in fact, it is a crime not to include them in your documents.

Adding the index is as easy as putting a new annotation on the property in its document class (for @Index) and run a bit of code in Symfony to build it out. The two lines you'll need to execute are included in the post.

7 comments voice your opinion now!
symfony document orm doctrine index tutorial


Zend Developer Zone:
Creating PDF Documents with Zend Framework
August 31, 2010 @ 14:27:15

On the Zend Developer Zone there's a new post by Vikram Vaswani about a method for creating PDF files directly from a Zend Framework application (hint: it uses Zend_Pdf).

PHP comes with a number of options to help developers dynamically generate PDF files from within their applications. The Haru and PDFlib extensions offer a complete API for dynamic PDF generation, and there also exist a number of open-source PHP components that can be used for the same purpose. This article will introduce you to one such component, the Zend_Pdf component that ships as part of the Zend Framework, and illustrate how it can be used to perform sophisticated PDF operations from within a PHP application.

The tutorial walks you through some of the introductory steps to using the component (outside of the framework) and create a sample PDF with some basic text. It gets more technical by adding in pictures, text wrapping, drawing lines and shapes, styling text and using things like the My_Pdf_Table feature to easily create tables. There's even a bit at the end about using the properties of the file to set things like title, subject and author.

0 comments voice your opinion now!
pdf tutorial zendframework zendpdf document



Community Events





Don't see your event here?
Let us know!


introduction podcast api series bugfix list library community laravel voicesoftheelephpant deployment language tips symfony release package framework install interview opinion

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework