couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Couchdb Wiki] Update of "Regenerating_views_on_update" by SebastianCohnen
Date Fri, 07 May 2010 19:59:36 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The "Regenerating_views_on_update" page has been changed by SebastianCohnen.
The comment on this change is: added toc, added syntax hl.
http://wiki.apache.org/couchdb/Regenerating_views_on_update?action=diff&rev1=8&rev2=9

--------------------------------------------------

  = Update views on document save =
+ <<TableOfContents(3)>>
  
  CouchDB defaults to regenerating views the first time they are accessed. This behavior is
preferable in most cases as it optimizes the resource utilization on the database server.

  On the other hand, in some situations the benefit of always having fast and updated views
far outweigh the cost of regenerating them every time the database server receives updates.
This can be achieved by supplying an updater script that calls the views when needed.
@@ -8, +9 @@

  == Example using ruby ==
  
  === couch.ini ===
- (0.8) Add the following line to the couch.ini file {{{
+ (0.8) Add the following line to the couch.ini file
+ {{{
- 	DbUpdateNotificationProcess=/PATH/TO/view_updater.rb
+ DbUpdateNotificationProcess=/PATH/TO/view_updater.rb
  }}}
  
- (0.9) Add the following section to the local.ini file: {{{
+ (0.9+) Add the following section to the local.ini file:
+ {{{
  [update_notification]
  view_updater=/PATH/TO/view_updater.rb
  }}}  
@@ -20, +23 @@

  === view_updater.rb ===
  The following script updates the views for each tenth update made to the database or at
most once every second when a lot of saves are performed 
  
+ {{{#!highlight ruby
- {{{
- 
  #!/usr/bin/ruby
  
  ###################
@@ -120, +122 @@

  
  == Example using Python ==
  
- {{{
+ {{{#!highlight python
  
  #!/usr/bin/env python
  # -*- coding: utf-8 -*-

Mime
View raw message