horizon
horizon copied to clipboard
Some libary/framework suggestions
Hi @nullstyle I obviously lack a lot of knowledge about the goals of the project and the deliberations behind the choices made so far, and I'm also sure that you've considered a lot of Go libraries and frameworks already, so these are just my five cents and I'm assuming that I could be completely wrong on those :smile:
I recently bumped into the Revel web app framework, and coming from a Django background (and I know you're a Rails guy), I felt this could be pretty useful to get some "standard web app type of stuff", and also to quickly establish patterns within Horizon that other devs could quickly grasp and build on.
Also I couldn't help but notice that you're already following some Rails patterns, and perhaps you'll feel that Revel could save you a lot of work in further implementing those.
Besides that, the GORM library, which is, well, an ORM, caught my eyes. Although on the DB side it seems there is much more "non-standard" stuff going on, so perhaps max flexibility is more important.
Anyway, just a bunch of ideas I wanted to throw around...
@gterzian,
Thanks for the input, definitely appreciated. Let me reply inline:
I recently bumped into the Revel web app framework, and coming from a Django background (and I know you're a Rails guy), I felt this could be pretty useful to get some "standard web app type of stuff", and also to quickly establish patterns within Horizon that other devs could quickly grasp and build on.
I'm not especially opposed to using one of the larger web frameworks (my understanding is the Revel is considered a large framework in the space), but I lean away from it. My reasoning: the larger frameworks I've seen tend to have a lot of features around building html applications, whereas horizon is just an API. We probably won't be using features like sessions, flash, or internationalization and I would rather not include that code (and any defects they main contain) if possible. But that all can be overcome, for sure, if the benefit is there.
Besides that, the GORM library, which is, well, an ORM, caught my eyes. Although on the DB side it seems there is much more "non-standard" stuff going on, so perhaps max flexibility is more important.
Horizon did use GORM early on. As you guessed, I ended up dumping it for sqlx and squirrel because of the more complicated queries that horizon runs that GORM didn't have support for. I also ran into several strange issues, IIRC, but their details elude me. It's worth noting that you can pretty succinctly access a database with the current system. for example:
var ledgers []db.LedgerRecord
app.HistoryDB().Select(app.ctx, db.LedgerRecordSelect, &ledgers)
// or with conditions
app.HistoryDB().Select(app.ctx, db.LedgerRecordSelect.Where("sequence = ?", 1), &ledgers)
There's no need to go through the more complicated query system for one-off queries. Anyways, long story short, let me learn some more about Revel... it wouldn't be prudent to say yes or no based upon my current experience.
Thanks!
@nullstyle that all makes sense. Let me know what you find out!