
Node.js Examples – How Enterprises Use Node in 2016 - hfeeri
https://blog.risingstack.com/node-js-examples-how-enterprises-use-node-in-2016/
======
daxfohl
> Because of the way Node works we can attach debuggers, and set breakpoint
> steps through the code. If you wanted to debug these groovy scripts in the
> past, you would make some code changes upload it to the edge layer, run it,
> see if it breaks, make some more changes, upload it again, and so on

Can anyone expand on this? I haven't worked with Groovy, but most languages
have debuggers that let you attach to an existing process. Is this something
especially great about Node, or something especially horrible about Groovy?

~~~
vorg
Apache Groovy (around v 1.0 or 1.5) used to produce bytecode that could easily
be decompiled to Java code, but since version 1.6, the bytecode generated was
changed so it couldn't be decompiled with the tool I was using at the time --
I forget what it was, could have been JAD. I know the JVM situation has
changed a lot since then, but that breaking change was just one of those many
little things that put people off using Groovy for anything more serious than
quick'n'dirty scripting. I wouldn't imagine it would be easy to write a Groovy
debugger if the bytecode generated is still so non-standard it can't be
decompiled to Java source.

~~~
eeperson
Why would you need a decompiler to write a debugger for Groovy? The groovy
compiler supports including source code line numbers and variable names in
compiled jar files (just like Java). As a result you can use any Java debugger
to debug Groovy.

Also, why would you expect that Groovy can be compiled and then decompiled to
Java? This doesn't even work 100% going from Java to Java, and Groovy is going
to have idioms that doesn't map easily to Java idioms.

~~~
vorg
> The groovy compiler supports including source code line numbers and variable
> names in compiled jar files

I haven't used Groovy since v 1.8, and certainly didn't know about this
facility then.

> why would you expect that Groovy can be compiled and then decompiled to
> Java?

It worked in Groovy 1.0, and the decompiles to Java were useful back then when
Groovy often had unexpected behavior.

------
aphextron
>"Instead of two teams, one is a pure back end, and one is a pure front end -
consisting seven people overall - a ninja team of five can do both."

...said the manager.

------
zamalek
I really don't like it when a framework is touted to be the be-all-and-end-
all. The article tries to put this idea across. Node.js is nothing more than a
tool, it is good at some things and bad at others. It is not the ultimate
solution that "enterprise" developers can use for any problem.

~~~
collyw
It seems to attract the crowd who do tout it as a tool for everything, which
in turn puts me off learning it.

~~~
asimuvPR
I've been using Django for some years now and have taken an interest in
Node.js. In spite of Django (IMO) being simpler to get up and running. Node.js
is now everywhere and is making progress in the enterprise stack.

What I'd like to know (or make happen) is a Django equivalent in Node.js.
Something with a built-in Admin, ORM, and (server side) templating system.
Anything stable out there that fits my requirements?

~~~
collyw
Won't Django channels cover the same sort of tasks?

~~~
asimuvPR
I've been doing small projects to get settled with channels and it works very
nicely. The big difference with node and django is that Node is backed by
bigger entities than Django/Python. I love Django, and use it for many things,
but JS and node are winning a lot of ground.

------
Scarbutt
_How Node.js affected developer productivity at Netflix?

The developer productivity comes from breaking down the monolith into smaller,
much more manageable pieces._

How is that directly related to nodejs only? I mean, you can have a monolith
in one language and still break it down into smaller, more manageable pieces
in the same language.

~~~
niftich
Marketing and mindshare. Node.js encouraged that architecture as the proper
way to compose services, and you got async libraries for free. You could do
the same thing in Java, but with frameworks and libraries that weren't as
well-known before Node.js became popular.

------
JoshGlazebrook
I've been a Node.js developer for a couple years now and one thing I've
noticed is I've never come across a company that actually uses it for their
core api. There always seems to be a Java based (or another statically typed
typically 'monolith' language) backend api server that smaller node.js
microservices/apps communicate with.

~~~
olalonde
As someone who has been writing core APIs in Node.js for a few years now, one
thing I really miss is a good ORM. The best one is probably Bookshelf.js but
it's poorly maintained and lags behind more mature ORMs like Active Record in
terms of features and stability.

~~~
ruddct
Not to go too off-topic, but Sequelize is worth a look if you haven't played
with it already.

~~~
olalonde
I used Sequelize for a while before Bookshelf was released and haven't used it
since so I'm not sure how it compares these days. One thing I like about
Bookshelf is that the query builder (Knex.js) is fairly decoupled and it's not
that scary to drop down to the SQL layer. I still feel it's not quite as good
as it could be.

~~~
gaastonsr
This might not be objective because I hate sequelize but sequelize sucks! I
never understood its API. Is so clunky compared to Bookshelf.js.

Bookshelf is less opinionated on the way you integrate it with your web app
with makes it good to work with if you have strong opinions on how it should
integrate with your codebase.

------
quantumhobbit
Node is pretty viral in the "enterprise". My company is listed in the article
and I've seen node sneak into big java projects, you know just to run unit
tests for the frontend code. Then it takes on more and more responsibility
until the project is a node project with a little java rather than a java
project with a little node.

~~~
cheez
Well when the options are Java and Node, even I would choose Node.

~~~
eweise
I would choose Java. Java 8 with lambda functions and streams library, is a
much more pleasant experience than previous versions. If you take the same
library over framework approach with Java as you might with Node, you can
build microservices just as easily, and docker equalizes the deployment
effort. The main advantage I see with Node is working with JSON and a more
simplistic concurrency model but to me Java is getting on the reactive
bandwagon and beats Node by having more mature and stable libraries and by
being statically typed.

~~~
Scarbutt
What Java libraries are you talking about in this case?

~~~
latchkey
Jackson combined with JSOG is great. Resteasy as the endpoint layer with Guice
as the DI framework. Project Lombok to remove the java boilerplate. Run that
on AppEngine and you have an infinitely autoscaling application with zero
downtime. Use Objectify for the ORM with the Datastore. =)

------
stephenhuey
Mostly testimonials, but interesting examples for me to see considering I've
just got 6 months of full-time Node.js under my belt after many years in Java
and Ruby. There's a link from this blog post to the Node Hero Tutorial and I
don't remember coming across this recommendation to organize file structure
around features rather than roles:

[https://blog.risingstack.com/node-hero-node-js-project-
struc...](https://blog.risingstack.com/node-hero-node-js-project-structure-
tutorial/)

It looks like a good option to me. I just finished a standalone notification
system in one of our Node.js apps and all the files are organized more like
this than the typical Rails file structure.

------
jaequery
Is node.js really ready for mainstream? I've coded javascript for 10+ years
and I sometimes laugh at the state is in right now. There's a reason why we
are experiencing javascript fatigue and that's because it's not mature to the
point it should be mainstream yet. Recently the language tried to tackle the
callback hells with es7 async/await but it's way too hacky and I believe it's
got quite a ways to go before the language can be used to develop
elegant/pragmatic codes.

------
romanovcode
> GoDaddy started to use Node for the front-end

I don't get it. Do they mean asset compilation etc. How can one use Node in
front-end?

~~~
ralusek
I assume they mean they use it to build and serve their web pages, but not
necessarily their backend services. Ironically, Node is much better suited for
data APIs and backend services.

------
SadWebDeveloper
> Ferenc Hámori > PR & Marketing @RisingStack.

Confirmed: NodeJS is pure hype.

~~~
lghh
I can't tell if you're being cheeky or not, but the fact that a marketing
person wrote this does not confirm anything. Also, why would it even matter?

~~~
aphextron
To be fair, RisingStack basically exists because of Node hype. It's literally
their name. They've been putting out sensationalist articles like this for
years.

