Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NodeJS vs Play Framework for large project

I am really torn between two different stacks with which to build a large application. One the one hand there is this option:

  • Node.js
    • express
    • coffee script
    • coffeekup
    • mongoose/mongodb or
    • presistencejs/mysql


  • Play Framework w/ Scala
    • Anorm w/ mysql
    • or mongodb

The node.js path is appealing to me because i can write all of the server side code, views and client side code in coffeescript, which i already know. If i go down this road i am still not 100% sure which db path i would take. mongoose makes storing data quick and easy, but the lack of true relationships might be more difficult to work with given the data model i have in mind (very SQLish).

The Play Framework path is also appealing because i know the framework well when using Java, but i don't know much about Scala, so there would be a hit to productivity as i work through learning that language. The Anorm database access layer is appealing because i can write the SQL by hand which i would prefer, and have the results mapped to objects automatically, which saves a lot of effort.

I keep leaning towards node.js, but i'm not sold on the best db access layer to use. Anyone have any experience with any of this and can share some insight?

like image 807
Jason Miesionczek Avatar asked Oct 03 '11 19:10

Jason Miesionczek


People also ask

Is NodeJS good for big projects?

It is suitable for large enterprise projects that do complex and complicated computations and data processing. The comparison in terms of development time between Node. js and Java is that, Node. js is easier to learn than Java, leading to faster development when using Node.

Is Node JS good for heavy computation?

js receives a CPU bound task: Whenever a heavy request comes to the event loop, Node. js would set all the CPU available to process it first, and then answer other requests queued. That results in slow processing and overall delay in the event loop, which is why Node. js is not recommended for heavy computation.

Is NodeJS more scalable than Java?

For example, you can develop an application in Java and link to it with JavaScript through an engine like Rhinorun. However, in a real-world scenario, picking Node. js for your web application makes more sense. It's just faster and more scalable than Java, when it comes to web apps.

How is NodeJS better than other frameworks?

Considering the speed of the development, Node. js works is that it makes you string together different components, ease the process and flexibility of building entire application. The availability of Node. js developers are less compared to other technologies as it has come to common in recent years.


1 Answers

The stack you choose should depend upon the needs of your application. Let's look at Play vs. Node for their strengths:

Node

  • Real-time applications (chat, feeds)
  • Event-driven architecture
  • Can perform client-server duties (e.g. serve files), but not well-suited for this
  • Database management, testing tools, etc, available as additional packages

Play!

  • Client-server applications (website, services)
  • Share-nothing architecture
  • Can perform real-time duties (e.g. Websockets), but not well-suited for this
  • Database management (including migrations!), testing tools, etc, built into core

If your application more closely matches a traditional web-based model, Play is probably your best choice. If you need immediate feedback and real-time dynamic messaging, Node is the better choice.

For large traditional applications, seriously consider the Play! Framework because of the built-in unit and functional testing along with database migrations. If incorporated into the development process, these go a long way toward an end product that works as expected and is stable and error-free.

like image 173
Mike Avatar answered Sep 17 '22 14:09

Mike