4 ms·
Is the idea supposed to be that a web client (html+js) reads and writes directly to a CouchDB server? Where do you put business logic?
by cageface 16y ago
Is the idea supposed to be that a web client (html+js) reads and writes directly to a CouchDB server? Where do you put business logic?
- Avshalom 16y agoWell, in a normal web app you put it where you normally do; it gets shoved in various .rb or .py or whatever and you just call the database as usual. for an app written in coudb: http://guide.couchdb.org/editions/1/en/managing.html http://guide.couchdb.org/editions/1/en/managing.html is a breakdown of the source tree and explains things.
- k33n 16y agoAll business logic is in the database itself. It has ACL's and data validation built into one feature (update validation) and as for deciding which data to display and when, the map/reduce-based view API is extremely powerful. Force yourself to use CouchDB for a project where you're handling large amounts of data and you'll discover how incredible it really is. There's tons of other great features you'l pick up along the way too.
- simplify 16y agoIt certainly doesn't fit every application, but it's possible to write a write-controlled app using validation functions[1]. I've written an introduction to using Evently and CouchApp if you're interested in seeing how that works[2]. [1] http://guide.couchdb.org/draft/validation.html http://guide.couchdb.org/draft/validation.html [2] http://mindeavor.com/blog/the-anatomy-of-a-couchapp http://mindeavor.com/blog/the-anatomy-of-a-couchapp