While the blog is mostly down, here is a summary of the problems pointed out by the author: 1. View index updates - "Every write sets up a trap for the first reader to come along after the write" 2. Append-only database file - "Create(s) a huge operational headache", disk utilization, compaction, etc CouchDB has always been a poor choice for write-heavy applications. Sounds to me like a case of selecting the wrong to…
Why I'm Walking Away From CouchDB
11–19 of 19 posts
Re: Why I'm Walking Away From CouchDB
#12While the blog is mostly down, here is a summary of the problems pointed out by the author: 1. View index updates - "Every write sets up a trap for the first reader to come along after the write" 2. Append-only database file - "Create(s) a huge operational headache", disk utilization, compaction, etc CouchDB has always been a poor choice for write-heavy applications. Sounds to me like a case of selecting the wrong to…
In the next article, titled "What I look for", he mentions that he'd never use a stored proc to access data through SQL. To me it sounds like he is almost refusing to use an RDBMS to its fullest.
Re: Why I'm Walking Away From CouchDB
#1320,000 new documents per _day_ (from the article) is absolutely nothing for CouchDB. Our dataset in Couch is 28 million records, takes up 13GB of data, and we can create a brand new view against those records and have it run the first time in less than ten minutes. Adding 20k records to this dataset might cause the view to take a couple of seconds to update. One update to the view, which is what the article complains about, takes one or two milliseconds to be added.
But let's hypothetically say that the author has the most complex data format in history, and the most complex view code in history, and ten writes to the database actually cause minutes worth of view index updating. Adding the "&stale=update_after" request parameter to your view query returns instantly, with the last-generated view. After the query is issued, the view is automatically updated. No cron jobs necessary-- it is (and should be) a drop-in addition for all of your view queries.
Now, about the append-only database file. We've been playing with autocompaction from CouchDB 1.2, and it seems to be working quite well, but again, at the scale the author is talking about, 20k records per day is a very predictable delta in disk space. Even running CouchDB off a 32GB compact flash card (and it is possible!) will give ample room for the size of his dataset. We run off a 120GB fibre channel mount and haven't needed to increase the partition size yet.
From the article:
"The system in question does a lot of writes of temporary data that is followed up by deletes a few days later. There is also a lot of permanent storage that hardly gets used."
That, to me, speaks to two separate databases, one for the temporary data, one for long-term storage. The temporary database can be compacted once per day, and the permanent storage could be compacted once per week/month/never.
Re: Why I'm Walking Away From CouchDB
#14After reading the article, I'm convinced that the author has something really, really, REALLY wrong with their data format, or their view code. 20,000 new documents per _day_ (from the article) is absolutely nothing for CouchDB. Our dataset in Couch is 28 million records, takes up 13GB of data, and we can create a brand new view against those records and have it run the first time in less than ten minutes. Adding 20k…
stale=update_after is not useful in my case. the client reads the database for the latest geographical position. it must return the lastest data in the database. update_after means its ready 'next time' but there wont be a next time, the client will simply have stale data. What the site needs is view updating after every write. If couchdb were to add that, I'd be excited.
I was excited about auto-compaction in 1.2 but the core problem remains that rewriting every single record to a new spot on disk at every compaction is a tremendous waste of I/O and write cycles on a (SSD) disk. Splitting the data in two sounds untenable for even simple queries (every search done twice, merging answer sets, etc).
Re: Why I'm Walking Away From CouchDB
#15After reading the article, I'm convinced that the author has something really, really, REALLY wrong with their data format, or their view code. 20,000 new documents per _day_ (from the article) is absolutely nothing for CouchDB. Our dataset in Couch is 28 million records, takes up 13GB of data, and we can create a brand new view against those records and have it run the first time in less than ten minutes. Adding 20k…
The documents are simple and small. Maybe 15 keys and short string values like datetime and latitude/longitude. 20,000 documents should be nothing but adding that much then doing a read triggers a view reindexing that was taking minutes . There are 2 million records taking about 1.6GB of disk. Doing on order of 100,000 deletes was bring disk usage up to 1.8GB or higher. stale=update_after is not useful in my case. th…
"What the site needs is view updating after every write."
So why not build that into your application? For every write that you want to be consistently shown in the very next client view, ensure that you spawn a thread to immediately issue a query to the view after the write. Remember, CouchDB does not try to be an ACID-level database, substituting the C for raw speed. In fact, you can't be guaranteed that a client won't get the view while a new record is being added, and with no blocking on write, your client now has out of date data. With such a small amount of database traffic, you don't really notice this side-effect of Couch.
"I was excited about auto-compaction in 1.2 but the core problem remains that rewriting every single record to a new spot on disk at every compaction is a tremendous waste of I/O and write cycles on a (SSD) disk."
With the number of IOPS that we're talking about here, your SSD will last for years and years and years, even if you ran compaction once every minute. A 256GB SSD costs $200 at Amazon, and with your Couch instance taking 1.8GB, I'd be more worried about the heat death of the Universe before worrying about running out of disk space or SSD write operations.
Re: Why I'm Walking Away From CouchDB
#16Re: Why I'm Walking Away From CouchDB
#17Re: Why I'm Walking Away From CouchDB
#18Sweeping generalizations usually are wrong. Also, 20K writes a day are nothing.
Re: Why I'm Walking Away From CouchDB
#19Earlier quoted context omitted.
The documents are simple and small. Maybe 15 keys and short string values like datetime and latitude/longitude. 20,000 documents should be nothing but adding that much then doing a read triggers a view reindexing that was taking minutes . There are 2 million records taking about 1.6GB of disk. Doing on order of 100,000 deletes was bring disk usage up to 1.8GB or higher. stale=update_after is not useful in my case. th…
You have something extremely wrong. Maybe it's at the hardware level. Maybe you have a crap SSD. Something. I just created a test database on my workstation, with a spinning disk, with the same type of data, and a temporary view against 50k documents takes 10 seconds to establish. Saving the view, re-running, then adding 10k documents and re-running the view takes 4 seconds to update. The 60k records take up 110MB. "…
The number of write cycles on an SSD is also a distraction. Its the principle that gigs and gigs of records that are essentially read only are physically moved to another spot on the disk every six hours (thats how often a cron job kicks off compaction) is still a tremendous waste of effort/bandwidth/whathave-you.