Show HN: Scaffold App for Node.js, Express, Jade, Passport, MongoDB, Bootstrap
github.com
github.com
- Demo: https://koa-skeleton.danneu.com/
- Source: https://github.com/danneu/koa-skeleton
app.get('/', function * () {
this.body = yield User.all()
})
vs app.get('/', function (req, res) {
User.all(function (err, users) {
if (err) throw err
res.end(users)
})
})There seem to be a large number of people who came into the tech-startup industry through programming a bit of Javascript, maybe from a web design background, who never had a formal education in computer science, who suddenly found out that they could write 'full' web apps in Javascript, and they could query a database in Javascript, but never learnt enough to know why this is a bad idea.
I'm not saying this is all bad, or that all Node devs are bad at all. Node is a good tool for a certain set of problems, and there are some excellent tools in the ecosystem and some great devs. But I think it is the easiest ecosystem to be a terrible developer in, and still get stuff working.
> But I think it is the easiest ecosystem to be a terrible developer in, and still get stuff working.
That honour would go to PHP, as far as I'm concerned. JS has many more fail-hard scenarios, and if you don't adapt your attitude to learn about things before using them, you're very quickly going to run into brick walls due to the entire callback thing.
Neither really has anything to do with MongoDB either - there's nothing inherently JS-y about MongoDB (JSON isn't JS), it just happens to have picked up a lot of traction around those parts.
The "MEAN" stack exists, MongoDB is popular in the JS community, and I feel they both exhibit many of the same hints of a fundamental lack of understanding about tools from a significant number of users.
As I said, there are great JS devs, and I'm sure there are some people using MongoDB for the 'right' things, but I don't think it's the majority.
I'm not saying SQL databases are bad. It's just... They are not the only choice! You should be happy that now we have tons of alternatives to choose.
2. Even among non-relational document storage solutions, Mongo has a poor reputation. As someone else says elsewhere in the comments, it's hard to trust a team that let so many ridiculously dangerous bugs (and a basically unreliable design) out into production for so long.
The issue isn't MongoDB is bad and relational DBs are awesome. The real issue is new developers being taught that Mongo and NoSQL in general are the databases you should be using with Node. The problem secondary to that is devs not knowing when each is appropriate.
Every iPhone, and Android phone have SQLite running on them, which easily makes it the most used production database. It's use case is typically very low traffic websites or as client side storage.
It is interesting how much penetration SQLlite has on the client, though.
At any rate, I know better than to not be extremely specific so I brought this on myself.
This all started when someone trashed RDBMS for being "heavy", implying that Mongo is good because it's light.
Why would you care how heavy a DB is if it's not on the client side? The kind of memory and storage you need for even the heaviest popular RDBMS (MySQL?) is still low enough that's nearly free to create a small app.
It's about time the "develoment only" myth was laid to rest. Please read the links bellow:
https://charlesleifer.com/blog/sqlite-small-fast-reliable-ch...
http://stackoverflow.com/questions/1711631/improve-insert-pe...
http://stackoverflow.com/questions/784173/what-are-the-perfo...
http://cryto.net/~joepie91/blog/2015/07/19/why-you-should-ne...
And if you really have minimal requirements, I recommend SQLite.
You know why many SQL databases use a lot of RAM? Because it improves their performance. They don't require the RAM, they just use it when it's available. Would you rather that it uses your free RAM to speed up your database operations, or to just have it sit idle doing nothing?
As for not being "the only choice" - while technically correct, this is very misleading. SQL databases and schemaless/document stores are _not interchangeable_. They are used for different usecases with different data models and different integrity requirements.
MongoDB is a special one entirely - even for a schemaless document store, it's just very poorly designed and maintained. Use any of the many other such databases - which gained a reputation by actually working well in production, rather than its developers organizing lots of hackathons as a marketing stunt.
We get a lot of folks who start with a Mongo evaluation and end up moving to something more serious.
Also, mongo has very good drivers for every language, likely that is a good reason.
It has much more middleware, but is easy to strip down, based on what you're building. It also has a CLI tool for some basic config.
I think that can be said about most products of scaffolds. If you intend to use this you should learn at least a little about node/express/jade/mongo/bootstrap as well. I feel a lot of people don't I know I didn't when I started web dev (I'm looking at you RoR).