I'm probably dreaming here, but am wondering if there's any possibility of completely embedding a minimal CouchDB engine within a Windows application, such that the app can be run without requiring installation (of CouchDB/Erlang) on the user's computer.
-
See http://stackoverflow.com/questions/1795628/erlang-compilation-erlang-as-stand-alone-executeable – Pindatjuh Jul 06 '11 at 22:24
-
2That is indeed the holy grail. Erlang has a different history than most popular languages (it is not a fish swimming in the Unix water). As crazy as this sounds, you might have better luck embedding V8 or NodeJS and using PouchDB. It may be easier to get PouchDB to feature parity with Couch than getting Erlang embeddable. The core Couch codebase is only 20k lines. I know this is crazy (hence a comment, not answer) but it's not *that* crazy. – JasonSmith Jul 07 '11 at 02:11
-
PouchDB sounds interesting--do you have any links? – devios1 Jul 07 '11 at 18:49
-
1@chaiguy - https://github.com/mikeal/pouchdb/ This effort has historically tended to be a moving target though. Unfortunately it won't work well from V8/node.js as it is built for browser usage — IIRC it assumes a DOM w/IndexedDB and even uses jQuery a little! Believe me, you're not the only one wanting to build CouchApps without CouchDB's heavyweight Mozilla/Erlang dependencies, it's just a matter of community resources... – natevw Jul 21 '11 at 22:18
4 Answers
I already provide this slimmed down / bundled ability - check here https://github.com/dch/couchdb/downloads and specifically the lean bundle at 16MiB erlang + all couch love here https://github.com/downloads/dch/couchdb/couchdb-1.1.0+COUCHDB-1152_otp_R14B03_lean.7z
Some brief notes on bundling and embedding couchdb on windows at wiki.apache.org/couchdb/Quirks_on_Windows including how to hide the erlang window (erl.exe -detached) at startup.
Ask on CouchDB @user mailing list if you want more info or help while you have a crack at this.

- 1,502
- 9
- 9
While not a code solution, you could use one of the bundling applications that can embed files and other files into one executable. One example would be BoxedApp.

- 8,520
- 1
- 29
- 35
The CouchDB wiki does provide at least a few tips for Integrating CouchDB into your Windows Applications. YMMV, from what I can tell it's more or less just tips on creating a relocatable build. You'll want to likely generate a solid random admin user/password into the local.ini file during the install process and set up proper permissions on all created databases (to protect against any potential cross-site scripting vulnerabilities) in addition to ensuring the socket binding only happens on the default localhost interface.

- 16,807
- 8
- 66
- 90
Why bother. It is so easy to install Erlang on Windows. Just bundle up the whole thing including the erl.exe binary and have your installer unzip it into a folder. The only thing that you would need to change would be the batch files, or better yet, discard them and write your own batch file to start up CouchDb. Also, it is a good idea to use a different port that either the normal Erlang port (or the usual CouchDB port) and maybe even get Erlang to use localhost as its "shortname".

- 31,973
- 6
- 70
- 106
-
One problem is the size. The installer is roughly 82 megs. This is absurd for a little 2 meg app. I was hoping there might be a slimmed down embeddable version or something. – devios1 Jul 07 '11 at 18:50
-
1Couchdb would not be a little 2 meg app if it did not leverage the Erlang VM and the Erlang OTP libraries. That would be like asking how to package a Java application without the JVM or the Java class libraries. If it helps, package up your Erlang runtime, separately from the CouchDB .beam files. That way people can upgrade without downloading the "Erlang runtime" over and over again. – Michael Dillon Jul 08 '11 at 00:51
-
Another reason is if you want to run couchdb on IIS/on website hosting. You have permission to copy files and run in IIS but not to install something into the OS. – DarcyThomas Aug 28 '15 at 20:51