Live data from Hacker News

Go-bootstrap: Generates a lean and mean Go web project

go-bootstrap.io

31–40 of 61 posts

Re: Go-bootstrap: Generates a lean and mean Go web project

#31

>It does not use ORM nor installs one. Take a look at [1]. Congratulations, you've written an ORM. The belief that ORMs are evil is precisely the belief that this sort of code should be repeated everywhere database access is performed. If you have generalized routines for interacting with the database with more comfortable abstractions then string concatenation, you are using an ORM, but possibly a poorly tested, poo…

And if you look at dal/README.md https://github.com/go-bootstrap/go-bootstrap/tree/master/bla... , they say that they got the "data access layer" defintion from wikipedia http://en.wikipedia.org/wiki/Data_access_layer , and in the last line of the wiki page says: > Object-Relational Mapping tools provide data layers in this fashion, following the active record model. The ORM/active-record model is popular with web fr…

[deleted]

Re: Go-bootstrap: Generates a lean and mean Go web project

#32
post #2

Excellent overview. I'm sick to death of landing pages that are vague, hard to navigate, and leave you wondering what the project is all about; you avoided all of that. In particular, the "Decisions made for you" clearly answers many of the questions someone will have when they investigate a project like this. Kudos.

Thanks for the feedback!

The project is aimed at getting up to speed as fast as possible, and the docs is geared towards that.

Re: Go-bootstrap: Generates a lean and mean Go web project

#33

>It does not use ORM nor installs one. Take a look at [1]. Congratulations, you've written an ORM. The belief that ORMs are evil is precisely the belief that this sort of code should be repeated everywhere database access is performed. If you have generalized routines for interacting with the database with more comfortable abstractions then string concatenation, you are using an ORM, but possibly a poorly tested, poo…

And if you look at dal/README.md https://github.com/go-bootstrap/go-bootstrap/tree/master/bla... , they say that they got the "data access layer" defintion from wikipedia http://en.wikipedia.org/wiki/Data_access_layer , and in the last line of the wiki page says: > Object-Relational Mapping tools provide data layers in this fashion, following the active record model. The ORM/active-record model is popular with web fr…

It may be technically true that this DAL is not really on ORM, but saying that the project skeleton does not contain an ORM is misleading at best. It would be simplest to just rework the language to something like, "a lightweight ORM" or "a database access layer like what's found in traditional ORMs" or something.

Re: Go-bootstrap: Generates a lean and mean Go web project

#34
post #30
post #22

I'm a bit confused as to why the initial step is a "git clone". Why not "go get"?

Great point! I've updated the instruction.

Looking better, but since the 'go get' step compiles your main.go and puts it in $GOPATH/bin/go-bootstrap, the instructions could be simpler still:

    go get github.com/go-bootstrap/go-bootstrap
    $GOPATH/bin/go-bootstrap -dir github.com/$GIT_USER/$PROJECT_NAME
    cd $GOPATH/src/github.com/$GIT_USER/$PROJECT_NAME && go run main.go

Re: Go-bootstrap: Generates a lean and mean Go web project

#35

>It does not use ORM nor installs one. Take a look at [1]. Congratulations, you've written an ORM. The belief that ORMs are evil is precisely the belief that this sort of code should be repeated everywhere database access is performed. If you have generalized routines for interacting with the database with more comfortable abstractions then string concatenation, you are using an ORM, but possibly a poorly tested, poo…

Most ORM's are evil. sqlachemy being the only one that I can think of that is not evil (assuming you don't use the object mapping feature). I have found time and again that ORM's create unintended consequences in productions. Generation after generation of ORM's I have dealt with always have the same problem the create N+1, bad queries, memory bloat and are horrible to deal with in production. Once almost all the database operations are replaces with hand writing queries the application performance as expected. It is amazing to me that even though experiences engineers who have had ORM failures continue to use them. Some of have found that the cost of ORM is greater than the benefit and prefer simple libraries.

Re: Go-bootstrap: Generates a lean and mean Go web project

#36
post #24
post #5

Would love to see something like this for RESTful Web Services built on Go with /users, auth, rate-limiting, etc already working out of the box.

Rate limiting isn't something your app should be concerned about. That should be handled a layer up, e.g. nginx. Chances are it does a much better job than whatever you could come up with.

Maybe if it's trivial blanket rate-limiting on a single server.

Anything more complicated that needs synchronization/database access, I'd rather just read and maintain application-level middleware. It's not rocket science.

Re: Go-bootstrap: Generates a lean and mean Go web project

#37
post #21

Earlier quoted context omitted.

without reference to this project - Perhaps you meant storing all session data is a bad idea versus just an ID? (If so, I'm with you) If not - how would you identify an authenticated user? Or, how would you look up all their relevant session data in the DB?

"securecookies" is a term used, at least in the context of github.com/gorilla/sessions, to refer to a session storage based on encrypting all of the session data and sending it as a cookie. That means all of your session data, including if the user is authenticated and even which user it is, is sent to the browser and back to the server on the next (and subsequent) request(s). This is an interesting concept, but IMHO…

Also, you don't need to sign or encrypt the cookie if it's just a securely random session_id.

Re: Go-bootstrap: Generates a lean and mean Go web project

#39
post #35

>It does not use ORM nor installs one. Take a look at [1]. Congratulations, you've written an ORM. The belief that ORMs are evil is precisely the belief that this sort of code should be repeated everywhere database access is performed. If you have generalized routines for interacting with the database with more comfortable abstractions then string concatenation, you are using an ORM, but possibly a poorly tested, poo…

Most ORM's are evil. sqlachemy being the only one that I can think of that is not evil (assuming you don't use the object mapping feature). I have found time and again that ORM's create unintended consequences in productions. Generation after generation of ORM's I have dealt with always have the same problem the create N+1, bad queries, memory bloat and are horrible to deal with in production. Once almost all the dat…

I think the real reason is that if you are using an ORM, then you should have probably used a non-relational database.

Re: Go-bootstrap: Generates a lean and mean Go web project

#40
post #3

I like the project. You integrated a lot of well known and standard packages that people writing Go-WebApps would want, and didn't make the project super heavyweight. Very useful and still very light. I will definitely be using it, since one of my biggest problems with getting new go machines set up is going out and finding all the packages I have used in the past. On top of that, you got me another Gorilla Secure Co…

This project generates scaffolding code, that key should be generated too.
Post reply on HN