Reputation: 13
I have a question regarding Cloudant and the best practices regarding the storing of documents in the database. This is the scenario: For example, I want to store parsed contents of RSS feeds from multiple sources into Cloudant. How should I store them in a single DB? Option 1: Should I store the RSS feeds individually? Meaning all RSS items are stored there in a single DB regardless of their source and I'll just put a tag that specifies their sources. Example document would be:
{
source:"",
title:"",
date:"",
link:"",
text:""
}
Option 2: Should I compile the RSS feeds from each source and store the compiled feed into the DB? Example document would be:
{
feedsFromA[{
title:"",
date:"",
link:"",
text:""
}]
}
What are your inputs? What should I consider? TIA
Upvotes: 0
Views: 239
Reputation: 1986
I'd recommend storing each item as a document (option 1 that you already suggested), and using something like the source field to allow you to filter by where they came from. The considerations would include how large each document would get and, if the items are included in a document-per-RSS source, how often that might change. The worry is that you get a document with lots of nested data in it and if that data might change rather than just append, conflicts may occur. If the documents are just per-item, it's less likely for that to be a problem.
Upvotes: 1