3 ms·
Unsure if this is the right place to ask, but given this is go example project and as being someone new to Golang - I'm looking for advice in couple of topics:
by bkovacev 8y ago
Unsure if this is the right place to ask, but given this is go example project and as being someone new to Golang - I'm looking for advice in couple of topics:
* database migrations - Does it make sense to have a library take care of this for me? Is there a battle tested library?
* orm? does it really affect performance that much? is there a favorite?
- sambull 8y agoI like go-migrate [0] with postgres and sqlx [1] for just the right amount of orm. [0] https://github.com/golang-migrate/migrate https://github.com/golang-migrate/migrate [1] http://jmoiron.github.io/sqlx/ http://jmoiron.github.io/sqlx/
- ben_jones 8y agoIt really depends on your project requirements. Most projects have relatively simple requirements for migrations and SQL generation and can easily find tooling in both Golang and other languages by doing a simple Google search. Similarly for performance you need to assess the needs of your application, prototype, and benchmark to identify bottlenecks. Most people I see asking for performance tips never actually complete enough of the project to experience the performance implications they are so worried about. To summarize Go has never failed me in a web-oriented project (usually in the context of a REST API). Don't get me wrong, it has plenty of warts. Often you'll feel like you are writing lots of boiler plate. You won't get the advantages (and disadvantages) of "move fast and break things" ecosystems like Node or Rails. I've never regretted choosing Go. PS: its a more advanced topic but code generation + Golang is transcendant if you find yourself writing lots of boilerplate. Huge boost to productivity when applied correctly.
- mythrwy 8y agoJust digging into first Golang application (existing, no structure, everything in one folder except templates and static css etc., no front end JS library). No migrations. Had the exact same question. Was looking at this: https://github.com/golang-migrate/migrate https://github.com/golang-migrate/migrate Thinking Vue for front end also. Very timely main post because have been wondering best way to lay structure on the project. Simple is good and sure don't mind getting away from big framework bureaucracy, but 100 files in a folder can't be the way to go.