0

While developing my application I noticed, that I put more and more complexity in list. Like "joining" related docs. Or manipulating the output based on query parameters. As we know, there is a lot of stuff that can be put in lists. Stuff that could also be handled by the middleware (if you not developing a couchapp).

Just to be sure the question: How far can/should one go with lists?

Community
  • 1
  • 1
Aron Woost
  • 19,268
  • 13
  • 43
  • 51

2 Answers2

0

You should only go to about 12 on the Jason Scale ;)

Very hard to quantify the answer. JS within Couch is as fast as JS outside of Couch, which is slower than native code, faster than some other interpreters, and slower than some other interpreters. The short answer is that if you like writing code in lists, and it works in with your development environment, then relax, don't stop until/unless it becomes a problem.

smathy
  • 26,283
  • 5
  • 48
  • 68
  • 1
    I'm surprised, that I don't find the term "relax" in your answer... :) But yes, the question is very vague. See, the thing is that in all the stuff I read about lists there was never someone saying "Stop, don't do this. This might be a bottleneck". More the opposite. Thanks anyway, I might gonna write some tests at some point. – Aron Woost Aug 15 '12 at 07:14
0

The problem with lists is that they are executed on each request. It may not be a problem for you, but I prefer to avoid using lists, and design the documents and the application to not need lists. That said, nothing stops you from putting some caching mechanism in front of your couch to reduce server load.

Marcello Nuccio
  • 3,901
  • 2
  • 28
  • 28
  • Thanks for your answer. Well, certain things need to be done per request. The question is if this should be handled in couch lists or in the middleware. – Aron Woost Aug 16 '12 at 21:14
  • Yes, certain things need to be done per request. What I'm saying is that, in my experience, this feature is overused. I always try to avoid lists because they are very heavy compared to map/reduce or batch processing. For now, I've always found other solutions, but it's impossible to say if this is possible for you without knowing your use case. – Marcello Nuccio Aug 17 '12 at 10:36
  • Understood. Thanks for getting back to this. – Aron Woost Aug 17 '12 at 11:38