Today I've found some interesting library - ActiveJDBC. It provides RoR-like ActiveRecord interface, and I'm thinking on Hibernate replacement, but there is a question - can ActiveJDBC handle really big queries and results and is it clever to use it instead of Hibernate in any application?
-
From my experience and knowledge, I would say, ActiveJDBC will be much faster than Hibernate as it doesn't involve much of the overhead underlying the Hibernate. However, since it is not a JPA-based implementation, it will be diffcult if you want to move to another ORM in future. Also, changing the DB schema requires writing "DB Migration" scripts in ActiveJDBC, whereas it is much easier in Hibernate with an updation of the entity class. I can't say if it is clever to use to replace Hibernate, but it all depends on the context. – Mubin Jun 13 '13 at 14:10
-
Can you post it as an answer? I think I'll use both – skayred Jun 13 '13 at 14:39
1 Answers
I'm a developer of ActiveJDBC, so take my advice with a grain of salt :). I have not performed extensive performance comparison tests, but simple tests (storing and reading tens of thousands of records) revealed that ActiveJDBC is about twice as slow as JDBC, and Hibernate is about twice as slow as ActiveJDBC, which makes Hibernate about 4 times slower than plain JDBC. Overall, ActiveJDBC is a lot thinner than Hibernate, that was the idea for developing it. Please see this blog: Just how thin can a framework be? ActiveJDBC vs Hibernate.
Hibernate is architecturally built with client/server model in mind in the 90s (sessions, lazy loading, object graphs. etc.), while ActiveJDBC was built in 2009 primarily for request/response of modern web applications and uses a pass-through model. Depending on your logic, data and database optimizations, your mileage will vary, but I'm confident that ActiveJDBC will almost certainly be faster. Mubin pointed out the fact that you will need migrations. I'd say this is partly correct. Migrations system is always a good idea, but ActiveJDBC does not care how tables were created, as long as they exist.
cheers

- 5,432
- 2
- 31
- 46
-
Currently I'm trying to use it with `FlyWay` as a migration engine, and it looks exactly like RoR ActiveRecord, so I like it. But I'm developing kinda platform, so I have to respect other developers and provide Hibernate interface too. – skayred Jun 13 '13 at 16:40