On Tue, Jul 16, 2013 at 4:03 PM, Alexander Shorin <[email protected]> wrote:
> Hi, > > > 1 - How is data represented in CouchDB as compared to MySQL? How can I > create (or visualize in my head) multiple tuples of the same type of data > (as in a table that has columns of specific types and then each entry is a > row)? > > Nohow. These are two very different databases with different > approaches to store and work with data. Forget about MySQL's > relations, sql itself, tuples and field of sets algebra. Think in > document-oriented way. > > > If I need to store multiple orders in a system (where the data looks > roughly the same, how would that look? > Each order as a separate document. > > > 2 - How is binary data handled inside of CouchDB? As in, how is data > stored inside of CouchDB and then used (text and binary)? > Deep inside CouchDB stores data on disk in Erlang binary terms, but > for public it works with JSON: accepts JSON data and returns JSON > data. So as you know JSON is not friendly for binary data, but there > is special case store binary data as document's attachments. See docs > for their API: > http://docs.couchdb.org/en/latest/api/documents.html#get-db-doc-attachment > http://wiki.apache.org/couchdb/HTTP_Document_API#Attachments > > > 3 - Is this something that will be explained later in the book or did I > miss something important? > Sure it will (; But also you'd missed attachments section: > http://guide.couchdb.org/draft/api.html#attachments > > > -- > ,,,^..^,,, > > > On Tue, Jul 16, 2013 at 11:51 PM, Yves S. Garret > <[email protected]> wrote: > > Hi, > > > > I've recently picked up this book: > > http://guide.couchdb.org/editions/1/en/index.html > > > > I've read Part I and so far so good. However, as I'm going through the > > book, I'm having some > > nagging concerns. Here are the questions that I have: > > 1 - How is data represented in CouchDB as compared to MySQL? How can I > > create (or visualize in > > my head) multiple tuples of the same type of data (as in a table that has > > columns of specific types > > and then each entry is a row)? If I need to store multiple orders in a > > system (where the data looks > > roughly the same, how would that look? > > 2 - How is binary data handled inside of CouchDB? As in, how is data > > stored inside of CouchDB > > and then used (text and binary)? > > 3 - Is this something that will be explained later in the book or did I > > miss something important? > > > > Thanks in advance. > Ok. Say in MySQL I have an orders table, a customers table and an items table (where the stuff that I want to sell is located). How would this look like in CouchDB? So you would have each customer, order and items document, but how would you differentiate between the 3 types of documents? I realize that this is not the same as MySQL, but I'm trying to find the relationships (and model them in my head) as to how I could do the same thing in CouchDB.
