O'Reilly logo

CouchDB and PHP Web Development Beginner's Guide by Tim Juravich

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Posts

We have a placeholder for posts on our profile. But, let's get into filling it in with some real content. We are going to do this by allowing users to post small pieces of content and by having them tied to the user account.

Modeling Posts

Let's talk through what needs to happen in order for us to save posts to CouchDB and relate them to a user. Before we get into how to do this with CouchDB, let's try to bring it into perspective by looking at how we would do it with MySQL.

How to model posts in MySQL

If we were modeling this relationship for MySQL (or another RDBMS), it might look similar to the following screenshot:

How to model posts in MySQL

In a nutshell, this diagram ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required