How would you create a blog using a document repository (e.g. CouchDB, Redis, MongoDB, Riak, etc.),

I am a little embarrassed to admit this, but I am having problems with the concept of archiving data in a non-relational world. Especially considering that most document stores / KVs have slightly different functions.

I would like to learn from a concrete example, but I could not find anyone to discuss how you could architecture, for example, on a blog using CouchDB / Redis / MongoDB / Riak / etc.

There are a number of issues that I think are important:

  • Which data bits should be denormalized (for example, tags probably live with the document, but what about users)
  • How do you link documents?
  • What is the best way to create summary views, especially those that require sorting (like a blog index).
+5
source share
3 answers

First of all, I think that you will want to remove redis from the list, since it is a keystore, not a document store. Riak is also a key repository, but you can be a document repository with a library like Ripple .

In short, to model an application with a document repository, you need to find out:

  • . , . . , , .
    • , , , .
    • User and Role. . , , .
  • () . , .

    { article : { comments : [{ content: 'yada yada', timestamp: '20/11/2010' }] } }

    , , - , mongodb 5 .

  • . :
    • . { article: { tags: ['news','bar'] } }
    • , { user: { role_ids: [1,2,3]}}

. .

+3
  • , , / /. , , . , , , , .

  • SQL - , . , ids . , .

  • , , . , , /, , ad-hoc- , SQL.

+1

All Articles