You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Paulo Cassiano <pc...@gmail.com> on 2009/10/27 15:04:14 UTC

How could I use CouchDB in an e-commerce app?

Every e-commerce app shows at least one product's picture, along with
descriptions and other useful information. Does CouchDB supports images -
JPEG, GIF and so on - files?

How could I use CouchDB in an e-commerce app?

Re: How could I use CouchDB in an e-commerce app?

Posted by Paulo Cassiano <pc...@gmail.com>.
On Tue, Oct 27, 2009 at 2:09 PM, Alan Bell <
alan.bell@theopenlearningcentre.com> wrote:

> maybe have a couch document per product with description and photos to
> do your catalog, then when someone places an order create a document to
> represent that order containing line items and quantities they want.
>

Thanks!



> With other documents representing contents of warehouses or other
> objects in the system you can shuffle values about and ship the product
> to them.
> If you had asked the question "how do I develop an e-commerce
> application in MySQL" it would be an equally hard question to give a
> short answer to.
>
> Alan.
>
> Paulo Cassiano wrote:
> > I'm totally newbie in CouchDB, but I belive it could be ready for
> production
> > use. True. I only was thinking about how could I develop some e-commerce
> app
> > using it as DB server... Did you think about it before?
> >
> > On Tue, Oct 27, 2009 at 1:50 PM, Elf <el...@gmail.com> wrote:
> >
> >
> >
> >> --
> >> ----------------
> >> Best regards
> >> Elf
> >> mailto:elf2001@gmail.com
> >>
> >>
> >
> >
>
>

Re: How could I use CouchDB in an e-commerce app?

Posted by Alan Bell <al...@theopenlearningcentre.com>.
maybe have a couch document per product with description and photos to
do your catalog, then when someone places an order create a document to
represent that order containing line items and quantities they want.
With other documents representing contents of warehouses or other
objects in the system you can shuffle values about and ship the product
to them.
If you had asked the question "how do I develop an e-commerce
application in MySQL" it would be an equally hard question to give a
short answer to.

Alan.

Paulo Cassiano wrote:
> I'm totally newbie in CouchDB, but I belive it could be ready for production
> use. True. I only was thinking about how could I develop some e-commerce app
> using it as DB server... Did you think about it before?
>
> On Tue, Oct 27, 2009 at 1:50 PM, Elf <el...@gmail.com> wrote:
>
>
>   
>> --
>> ----------------
>> Best regards
>> Elf
>> mailto:elf2001@gmail.com
>>
>>     
>
>   


Re: How could I use CouchDB in an e-commerce app?

Posted by Paulo Cassiano <pc...@gmail.com>.
> You use bad terminology.

Sorry for my bad terminology... I use most of this terminology/terms
interchangeably.. but I think my main question was already adressed.

Thanks.


On Tue, Oct 27, 2009 at 1:59 PM, Elf <el...@gmail.com> wrote:

> You use bad terminology.
> If you need application, you need production-ready database. Couchdb
> is production-ready, so, you can write application. "E-commerce
> application" is subset of "application", so, you can use couchdb for
> e-commerce.
>
> 2009/10/27 Paulo Cassiano <pc...@gmail.com>:
> > I'm totally newbie in CouchDB, but I belive it could be ready for
> production
> > use. True. I only was thinking about how could I develop some e-commerce
> app
> > using it as DB server... Did you think about it before?
> >
> > On Tue, Oct 27, 2009 at 1:50 PM, Elf <el...@gmail.com> wrote:
> >
> >> Couchdb is ready for production use.
> >>
> >> 2009/10/27 Paulo Cassiano <pc...@gmail.com>:
> >> > OK, infact, that's could be a much bigger question.
> >> >
> >> > But I think I'm not the only guy to think about this... If YOU were
> asked
> >> to
> >> > do this, how did you do?
> >> >
> >> > On Tue, Oct 27, 2009 at 1:07 PM, Matt Goodall <matt.goodall@gmail.com
> >> >wrote:
> >> >
> >> >> 2009/10/27 Paulo Cassiano <pc...@gmail.com>:
> >> >> > Every e-commerce app shows at least one product's picture, along
> with
> >> >> > descriptions and other useful information. Does CouchDB supports
> >> images -
> >> >> > JPEG, GIF and so on - files?
> >> >>
> >> >> Each CouchDB doc can have multiple attachments, see
> >> >> http://wiki.apache.org/couchdb/HTTP_Document_API#Attachments.
> >> >>
> >> >> I would say a "product" makes an almost perfect CouchDB document. The
> >> >> document itself could contain whatever data the product needed to
> >> >> describe it (description, options, price, bulk prices, etc, etc) and
> >> >> the images of the product would be its attachments.
> >> >>
> >> >> >
> >> >> > How could I use CouchDB in an e-commerce app?
> >> >>
> >> >> That's a much bigger question ;-).
> >> >>
> >> >> - Matt
> >> >>
> >> >
> >>
> >>
> >>
> >> --
> >> ----------------
> >> Best regards
> >> Elf
> >> mailto:elf2001@gmail.com
> >>
> >
>
>
>
> --
> ----------------
> Best regards
> Elf
> mailto:elf2001@gmail.com
>

Re: How could I use CouchDB in an e-commerce app?

Posted by Elf <el...@gmail.com>.
You use bad terminology.
If you need application, you need production-ready database. Couchdb
is production-ready, so, you can write application. "E-commerce
application" is subset of "application", so, you can use couchdb for
e-commerce.

2009/10/27 Paulo Cassiano <pc...@gmail.com>:
> I'm totally newbie in CouchDB, but I belive it could be ready for production
> use. True. I only was thinking about how could I develop some e-commerce app
> using it as DB server... Did you think about it before?
>
> On Tue, Oct 27, 2009 at 1:50 PM, Elf <el...@gmail.com> wrote:
>
>> Couchdb is ready for production use.
>>
>> 2009/10/27 Paulo Cassiano <pc...@gmail.com>:
>> > OK, infact, that's could be a much bigger question.
>> >
>> > But I think I'm not the only guy to think about this... If YOU were asked
>> to
>> > do this, how did you do?
>> >
>> > On Tue, Oct 27, 2009 at 1:07 PM, Matt Goodall <matt.goodall@gmail.com
>> >wrote:
>> >
>> >> 2009/10/27 Paulo Cassiano <pc...@gmail.com>:
>> >> > Every e-commerce app shows at least one product's picture, along with
>> >> > descriptions and other useful information. Does CouchDB supports
>> images -
>> >> > JPEG, GIF and so on - files?
>> >>
>> >> Each CouchDB doc can have multiple attachments, see
>> >> http://wiki.apache.org/couchdb/HTTP_Document_API#Attachments.
>> >>
>> >> I would say a "product" makes an almost perfect CouchDB document. The
>> >> document itself could contain whatever data the product needed to
>> >> describe it (description, options, price, bulk prices, etc, etc) and
>> >> the images of the product would be its attachments.
>> >>
>> >> >
>> >> > How could I use CouchDB in an e-commerce app?
>> >>
>> >> That's a much bigger question ;-).
>> >>
>> >> - Matt
>> >>
>> >
>>
>>
>>
>> --
>> ----------------
>> Best regards
>> Elf
>> mailto:elf2001@gmail.com
>>
>



-- 
----------------
Best regards
Elf
mailto:elf2001@gmail.com

Re: How could I use CouchDB in an e-commerce app?

Posted by Andrew Melo <an...@gmail.com>.
> Guys, speacking about attachments: can i create simple blob entries to
> upload images?

You *could* base64encode them if you wanted to stick them inline in
the document, but the attachments will be faster.


>
> 2009/10/27 Paulo Cassiano <pc...@gmail.com>
>
>> I'm totally newbie in CouchDB, but I belive it could be ready for
>> production
>> use. True. I only was thinking about how could I develop some e-commerce
>> app
>> using it as DB server... Did you think about it before?
>>
>> On Tue, Oct 27, 2009 at 1:50 PM, Elf <el...@gmail.com> wrote:
>>
>> > Couchdb is ready for production use.
>> >
>> > 2009/10/27 Paulo Cassiano <pc...@gmail.com>:
>> > > OK, infact, that's could be a much bigger question.
>> > >
>> > > But I think I'm not the only guy to think about this... If YOU were
>> asked
>> > to
>> > > do this, how did you do?
>> > >
>> > > On Tue, Oct 27, 2009 at 1:07 PM, Matt Goodall <matt.goodall@gmail.com
>> > >wrote:
>> > >
>> > >> 2009/10/27 Paulo Cassiano <pc...@gmail.com>:
>> > >> > Every e-commerce app shows at least one product's picture, along
>> with
>> > >> > descriptions and other useful information. Does CouchDB supports
>> > images -
>> > >> > JPEG, GIF and so on - files?
>> > >>
>> > >> Each CouchDB doc can have multiple attachments, see
>> > >> http://wiki.apache.org/couchdb/HTTP_Document_API#Attachments.
>> > >>
>> > >> I would say a "product" makes an almost perfect CouchDB document. The
>> > >> document itself could contain whatever data the product needed to
>> > >> describe it (description, options, price, bulk prices, etc, etc) and
>> > >> the images of the product would be its attachments.
>> > >>
>> > >> >
>> > >> > How could I use CouchDB in an e-commerce app?
>> > >>
>> > >> That's a much bigger question ;-).
>> > >>
>> > >> - Matt
>> > >>
>> > >
>> >
>> >
>> >
>> > --
>> > ----------------
>> > Best regards
>> > Elf
>> > mailto:elf2001@gmail.com
>> >
>>
>
>
>
> --
> --
> AnotherNetFellow
> Email: anothernetfellow@gmail.com
>

Re: How could I use CouchDB in an e-commerce app?

Posted by AnotherNetFellow <an...@gmail.com>.
It's really a strange question O_o

You have to work out a data model, CouchDB is only a db server, you need to
write the code and decide HOW to use it.

Guys, speacking about attachments: can i create simple blob entries to
upload images?

2009/10/27 Paulo Cassiano <pc...@gmail.com>

> I'm totally newbie in CouchDB, but I belive it could be ready for
> production
> use. True. I only was thinking about how could I develop some e-commerce
> app
> using it as DB server... Did you think about it before?
>
> On Tue, Oct 27, 2009 at 1:50 PM, Elf <el...@gmail.com> wrote:
>
> > Couchdb is ready for production use.
> >
> > 2009/10/27 Paulo Cassiano <pc...@gmail.com>:
> > > OK, infact, that's could be a much bigger question.
> > >
> > > But I think I'm not the only guy to think about this... If YOU were
> asked
> > to
> > > do this, how did you do?
> > >
> > > On Tue, Oct 27, 2009 at 1:07 PM, Matt Goodall <matt.goodall@gmail.com
> > >wrote:
> > >
> > >> 2009/10/27 Paulo Cassiano <pc...@gmail.com>:
> > >> > Every e-commerce app shows at least one product's picture, along
> with
> > >> > descriptions and other useful information. Does CouchDB supports
> > images -
> > >> > JPEG, GIF and so on - files?
> > >>
> > >> Each CouchDB doc can have multiple attachments, see
> > >> http://wiki.apache.org/couchdb/HTTP_Document_API#Attachments.
> > >>
> > >> I would say a "product" makes an almost perfect CouchDB document. The
> > >> document itself could contain whatever data the product needed to
> > >> describe it (description, options, price, bulk prices, etc, etc) and
> > >> the images of the product would be its attachments.
> > >>
> > >> >
> > >> > How could I use CouchDB in an e-commerce app?
> > >>
> > >> That's a much bigger question ;-).
> > >>
> > >> - Matt
> > >>
> > >
> >
> >
> >
> > --
> > ----------------
> > Best regards
> > Elf
> > mailto:elf2001@gmail.com
> >
>



-- 
--
AnotherNetFellow
Email: anothernetfellow@gmail.com

Re: How could I use CouchDB in an e-commerce app?

Posted by Paulo Cassiano <pc...@gmail.com>.
On Tue, Oct 27, 2009 at 2:34 PM, Jim Kass <ji...@nhrevolution.com> wrote:

> Paulo,
>
> If you are asking can couch be used for transactional systems, such as
> banking or payment processing...
>
> The database itself doesn't have any transactional locking mechanism.
> However, as all documents are revisions... You could actually add multiple
> documents with a transaction_state field, and then upon completing the
> transaction update the transaction_state field in that document.
>

Thank you.


>
> Because unlike SQL, there are no joins, foreign key restraints or
> cascading, in order to have a transaction that touches many "tables", you
> would need to rethink your data model to incorporate nested data structures
> in single documents.
>

I think I need to learn how to model data in the CouchDB way...

>
> One current deficiency is that you must retrieve documents in order to
> modify a field.  However this is easily abtracted in a library or class such
> that you could use a specified view to extract a subset of documents then
> loop through them to update a specified field, then either use bulk function
> or another loop to save the new version.
>
> A function like this in use in psuedocode:
>
> trans  = new CouchTransaction("myTransaction")
> trans.start()
> // do stuff
> trans.add(doc,db)
> trans.add(another_doc,another_db)
> If (condition) {
>    trans.commit()
> }
> trans.end()
>
> I'm sure others would have better algorithms for what a CouchTransaction
> class might involve, but this is off the top of my head.
>
> HTH,
> Jim
>
> Sent from my iPhone
>
>
> On Oct 27, 2009, at 8:55 AM, Paulo Cassiano <pc...@gmail.com> wrote:
>
>  I'm totally newbie in CouchDB, but I belive it could be ready for
>> production
>> use. True. I only was thinking about how could I develop some e-commerce
>> app
>> using it as DB server... Did you think about it before?
>>
>> On Tue, Oct 27, 2009 at 1:50 PM, Elf <el...@gmail.com> wrote:
>>
>>  Couchdb is ready for production use.
>>>
>>> 2009/10/27 Paulo Cassiano <pc...@gmail.com>:
>>>
>>>> OK, infact, that's could be a much bigger question.
>>>>
>>>> But I think I'm not the only guy to think about this... If YOU were
>>>> asked
>>>>
>>> to
>>>
>>>> do this, how did you do?
>>>>
>>>> On Tue, Oct 27, 2009 at 1:07 PM, Matt Goodall <matt.goodall@gmail.com
>>>> wrote:
>>>>
>>>>  2009/10/27 Paulo Cassiano <pc...@gmail.com>:
>>>>>
>>>>>> Every e-commerce app shows at least one product's picture, along with
>>>>>> descriptions and other useful information. Does CouchDB supports
>>>>>>
>>>>> images -
>>>
>>>> JPEG, GIF and so on - files?
>>>>>>
>>>>>
>>>>> Each CouchDB doc can have multiple attachments, see
>>>>> http://wiki.apache.org/couchdb/HTTP_Document_API#Attachments.
>>>>>
>>>>> I would say a "product" makes an almost perfect CouchDB document. The
>>>>> document itself could contain whatever data the product needed to
>>>>> describe it (description, options, price, bulk prices, etc, etc) and
>>>>> the images of the product would be its attachments.
>>>>>
>>>>>
>>>>>> How could I use CouchDB in an e-commerce app?
>>>>>>
>>>>>
>>>>> That's a much bigger question ;-).
>>>>>
>>>>> - Matt
>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>> ----------------
>>> Best regards
>>> Elf
>>> mailto:elf2001@gmail.com
>>>
>>>

Re: How could I use CouchDB in an e-commerce app?

Posted by Jim Kass <ji...@nhrevolution.com>.
Paulo,

If you are asking can couch be used for transactional systems, such as  
banking or payment processing...

The database itself doesn't have any transactional locking mechanism.  
However, as all documents are revisions... You could actually add  
multiple documents with a transaction_state field, and then upon  
completing the transaction update the transaction_state field in that  
document.

Because unlike SQL, there are no joins, foreign key restraints or  
cascading, in order to have a transaction that touches many "tables",  
you would need to rethink your data model to incorporate nested data  
structures in single documents.

One current deficiency is that you must retrieve documents in order to  
modify a field.  However this is easily abtracted in a library or  
class such that you could use a specified view to extract a subset of  
documents then loop through them to update a specified field, then  
either use bulk function or another loop to save the new version.

A function like this in use in psuedocode:

trans  = new CouchTransaction("myTransaction")
trans.start()
// do stuff
trans.add(doc,db)
trans.add(another_doc,another_db)
If (condition) {
     trans.commit()
}
trans.end()

I'm sure others would have better algorithms for what a  
CouchTransaction class might involve, but this is off the top of my  
head.

HTH,
Jim

Sent from my iPhone

On Oct 27, 2009, at 8:55 AM, Paulo Cassiano <pc...@gmail.com> wrote:

> I'm totally newbie in CouchDB, but I belive it could be ready for  
> production
> use. True. I only was thinking about how could I develop some e- 
> commerce app
> using it as DB server... Did you think about it before?
>
> On Tue, Oct 27, 2009 at 1:50 PM, Elf <el...@gmail.com> wrote:
>
>> Couchdb is ready for production use.
>>
>> 2009/10/27 Paulo Cassiano <pc...@gmail.com>:
>>> OK, infact, that's could be a much bigger question.
>>>
>>> But I think I'm not the only guy to think about this... If YOU  
>>> were asked
>> to
>>> do this, how did you do?
>>>
>>> On Tue, Oct 27, 2009 at 1:07 PM, Matt Goodall  
>>> <matt.goodall@gmail.com
>>> wrote:
>>>
>>>> 2009/10/27 Paulo Cassiano <pc...@gmail.com>:
>>>>> Every e-commerce app shows at least one product's picture, along  
>>>>> with
>>>>> descriptions and other useful information. Does CouchDB supports
>> images -
>>>>> JPEG, GIF and so on - files?
>>>>
>>>> Each CouchDB doc can have multiple attachments, see
>>>> http://wiki.apache.org/couchdb/HTTP_Document_API#Attachments.
>>>>
>>>> I would say a "product" makes an almost perfect CouchDB document.  
>>>> The
>>>> document itself could contain whatever data the product needed to
>>>> describe it (description, options, price, bulk prices, etc, etc)  
>>>> and
>>>> the images of the product would be its attachments.
>>>>
>>>>>
>>>>> How could I use CouchDB in an e-commerce app?
>>>>
>>>> That's a much bigger question ;-).
>>>>
>>>> - Matt
>>>>
>>>
>>
>>
>>
>> --
>> ----------------
>> Best regards
>> Elf
>> mailto:elf2001@gmail.com
>>

Re: How could I use CouchDB in an e-commerce app?

Posted by Paulo Cassiano <pc...@gmail.com>.
I'm totally newbie in CouchDB, but I belive it could be ready for production
use. True. I only was thinking about how could I develop some e-commerce app
using it as DB server... Did you think about it before?

On Tue, Oct 27, 2009 at 1:50 PM, Elf <el...@gmail.com> wrote:

> Couchdb is ready for production use.
>
> 2009/10/27 Paulo Cassiano <pc...@gmail.com>:
> > OK, infact, that's could be a much bigger question.
> >
> > But I think I'm not the only guy to think about this... If YOU were asked
> to
> > do this, how did you do?
> >
> > On Tue, Oct 27, 2009 at 1:07 PM, Matt Goodall <matt.goodall@gmail.com
> >wrote:
> >
> >> 2009/10/27 Paulo Cassiano <pc...@gmail.com>:
> >> > Every e-commerce app shows at least one product's picture, along with
> >> > descriptions and other useful information. Does CouchDB supports
> images -
> >> > JPEG, GIF and so on - files?
> >>
> >> Each CouchDB doc can have multiple attachments, see
> >> http://wiki.apache.org/couchdb/HTTP_Document_API#Attachments.
> >>
> >> I would say a "product" makes an almost perfect CouchDB document. The
> >> document itself could contain whatever data the product needed to
> >> describe it (description, options, price, bulk prices, etc, etc) and
> >> the images of the product would be its attachments.
> >>
> >> >
> >> > How could I use CouchDB in an e-commerce app?
> >>
> >> That's a much bigger question ;-).
> >>
> >> - Matt
> >>
> >
>
>
>
> --
> ----------------
> Best regards
> Elf
> mailto:elf2001@gmail.com
>

Re: How could I use CouchDB in an e-commerce app?

Posted by Elf <el...@gmail.com>.
Couchdb is ready for production use.

2009/10/27 Paulo Cassiano <pc...@gmail.com>:
> OK, infact, that's could be a much bigger question.
>
> But I think I'm not the only guy to think about this... If YOU were asked to
> do this, how did you do?
>
> On Tue, Oct 27, 2009 at 1:07 PM, Matt Goodall <ma...@gmail.com>wrote:
>
>> 2009/10/27 Paulo Cassiano <pc...@gmail.com>:
>> > Every e-commerce app shows at least one product's picture, along with
>> > descriptions and other useful information. Does CouchDB supports images -
>> > JPEG, GIF and so on - files?
>>
>> Each CouchDB doc can have multiple attachments, see
>> http://wiki.apache.org/couchdb/HTTP_Document_API#Attachments.
>>
>> I would say a "product" makes an almost perfect CouchDB document. The
>> document itself could contain whatever data the product needed to
>> describe it (description, options, price, bulk prices, etc, etc) and
>> the images of the product would be its attachments.
>>
>> >
>> > How could I use CouchDB in an e-commerce app?
>>
>> That's a much bigger question ;-).
>>
>> - Matt
>>
>



-- 
----------------
Best regards
Elf
mailto:elf2001@gmail.com

Re: How could I use CouchDB in an e-commerce app?

Posted by Paulo Cassiano <pc...@gmail.com>.
OK, infact, that's could be a much bigger question.

But I think I'm not the only guy to think about this... If YOU were asked to
do this, how did you do?

On Tue, Oct 27, 2009 at 1:07 PM, Matt Goodall <ma...@gmail.com>wrote:

> 2009/10/27 Paulo Cassiano <pc...@gmail.com>:
> > Every e-commerce app shows at least one product's picture, along with
> > descriptions and other useful information. Does CouchDB supports images -
> > JPEG, GIF and so on - files?
>
> Each CouchDB doc can have multiple attachments, see
> http://wiki.apache.org/couchdb/HTTP_Document_API#Attachments.
>
> I would say a "product" makes an almost perfect CouchDB document. The
> document itself could contain whatever data the product needed to
> describe it (description, options, price, bulk prices, etc, etc) and
> the images of the product would be its attachments.
>
> >
> > How could I use CouchDB in an e-commerce app?
>
> That's a much bigger question ;-).
>
> - Matt
>

Re: How could I use CouchDB in an e-commerce app?

Posted by Matt Goodall <ma...@gmail.com>.
2009/10/27 Paulo Cassiano <pc...@gmail.com>:
> Every e-commerce app shows at least one product's picture, along with
> descriptions and other useful information. Does CouchDB supports images -
> JPEG, GIF and so on - files?

Each CouchDB doc can have multiple attachments, see
http://wiki.apache.org/couchdb/HTTP_Document_API#Attachments.

I would say a "product" makes an almost perfect CouchDB document. The
document itself could contain whatever data the product needed to
describe it (description, options, price, bulk prices, etc, etc) and
the images of the product would be its attachments.

>
> How could I use CouchDB in an e-commerce app?

That's a much bigger question ;-).

- Matt