chanks
Edit: non-updated columns, I mean.
Sequel's model layer is also faster than ActiveRecord's, because much of the additional functionality that ActiveRecord piles onto all records (dirty tracking, single table inheritance, etc.) are available in Sequel via a plugin system. You can enable the plugins you want to use and not pay the overhead of all the others. You can even enable specific plugins for only the models where you'll actually want to use them.
It also has a lot less magic (no association proxies, unless you enable the plugin for them :)), ridiculously customizable (many more options for associations, custom eager loading logic, and so on), and has an implementation of its Postgres adapter written in C for performance.
Highly, highly recommended.
Edit: Oh, and an issue tracker that is almost always at zero, with a very fast response time. As someone who has contributed a patch to ActiveRecord, I can't tell you how nice that is.
This isn't terribly surprising to me, since I have an appreciation for what long-running transactions will do to a system, and I try to design systems to use transactions that are as short-lived as possible on OLTP systems. I realize that this should be explicitly mentioned in the docs, though, I'll fix that.
I'll also note that since the beginning Que has gone out of its way to use session-level locks, not transaction-level ones, to ensure that you can execute long-running jobs without the need to hold open a transaction while they work. So I don't see this so much as a flaw inherent in the library as something that people should keep in mind when they use it.
(It's also something that I expect will be much less of an issue in version 1.0, which is set up to use LISTEN/NOTIFY rather than a polling query to distribute most jobs. That said, 1.0 has been a relatively low priority for much of the last year, due to a lack of free time on my part and since I've never had any complaints with the locking performance before. I hope I'll be able to get it out in the next few months.)
Inconsistency between jobs and the rest of your data isn't a problem for many (or even most) use cases, but there are certainly times when you need it.
I have a Postgres-based job queue that uses advisory locks to get around some of the drawbacks he mentions (job lock queries don't incur writes or block one another like SELECT FOR UPDATE would). Feedback is welcome: https://github.com/chanks/que
I'm happy to answer any questions you or anyone else might have.
http://www.postgresql.org/docs/9.3/static/plpgsql-implementa...
Show HN: Que, a crazy-fast Ruby-PostgreSQL job queue
Show HN: Que, a Ruby-PostgreSQL job queue with ~20x the throughput of DelayedJob
Hi everyone - I wrote a job queue called Que, which uses Postgres' advisory locks to manage jobs very efficiently. My goal is to make it easy to cover jobs with the same ACID guarantees as the rest of your data. It won't be as fast as a dedicated or Redis-backed queue, but I expect it will be fast enough for many use-cases.https://github.com/chanks/queThe 20x figure comes from a benchmark I ran...
Turning PostgreSQL into a queue serving 10,000 jobs per second
I'm also looking for a steady job using Ruby, if anyone is hiring in Seattle. My email's in my profile.
Thanks!
Que: A fast, concurrent job queue for Ruby and PostgreSQL
U.S. intelligence agencies have their own Twitter. It’s called eChirp
json_merge('{"a":5,"b":7}', '{"b":6,"c":8}') -> '{"a":5,"b":6,"c":8}'
Extra security measures for next week's releases
PostgreSQL 9.3: Current Feature Status
How Zappos' User Agreement Failed In Court and Left Zappos Legally Naked
So if you're expecting a table to have a heavy UPDATE load it may be a good idea to lower its fillfactor from the default of 100 (for example, ALTER TABLE foo SET (fillfactor = 95);). This means that once a page is 95% full no new rows will be inserted into it, and the remaining 5% will be available for updated rows. HOT will also do "mini-vacuums" on individual pages as needed to free up space.
Of course, it's up to you to decide whether this tradeoff is worth increasing the effective size of your table by ~5%. But even tables with fillfactors at the default of 100 will get some benefit from HOT.
More info: https://github.com/postgres/postgres/blob/master/src/backend...
Edit to add: One caveat is that HOT won't work if you UPDATE a column that is indexed - then, of course, Postgres will have to touch the index.
It provides an ActiveModel-compliant interface, so it works fine with Rails. It also has a lot less magic (associations don't use proxy objects, for example) and has a lot of features that ActiveRecord is sorely missing (such as complete support for composite primary keys). I don't know what your other problems with ActiveRecord are, but Sequel is definitely worth a look. I'm very happy with it.