Hacker News new | comments | ask | show | jobs | submit login
Ask HN: Modern stacks and frameworks for fast web app development?
48 points by nthnclrk on May 5, 2013 | hide | past | web | favorite | 67 comments
I remember seeing a couple of links in the past about really fast, lightweight web application development frameworks that seem to streamline a lot of things — unfortunately I didn't bookmark any at the time. I'm sure one almost described itself as a Bootstrap for web apps. I'd love to find one or two, but it's proving difficult.

I sure most were ruby based — think Padrino.

In any case, It'd be nice to see some suggestions from the community here so I can make some educated choices for a couple of small projects I have planned.




Go with Gorilla Mux.

I use a Rails-ish directory structure {controllers,models,helpers,server,views} and can be knocking out the first skeleton pages and APIs in minutes.

I don't think Go needs a framework to be a really good fast web app language/environment.

If anyone is interested in a sample app I might knock one up just so that people can clone it and get started. There wouldn't be much to it, as I'm consumed by other work, but maybe people want such an example.


While I don't see myself switching any time soon, I think this kind of example is excellent for anyone looking to get a feel for how an unfamiliar language would actually be used in a semi-realistic situation (without having to dig through massive real-world projects with complexity that's normal for experienced devs but unintelligible to the uninitiated).


Cool, in that case I'll knock something up.

I'll try and make it realistic from the point of view of including many tasks that people generally want to do.

So I'll have it serve static files, read and write to a database, read a local config, cache stuff in memory, do something on a scheduled task basis, render templates.

Anything else anyone would like to see?

Not sure what I'll make that will require all of that, and I would like to keep it enough of a stub that people could rip out the example and quickly butcher it into whatever they wanted to prototype.

Maybe a code snippets site. I'm off out for the day, my first day off in 60 days, so I'll look at this tomorrow.


That much should be enough I think. Are you using the default templates ? I've seen that mustache has been ported to go.


Just got back from a long day away from the desk, will look at this tomorrow.

I'm thinking a good default would use the default templates (as they are good), memcached, PostgreSQL, have a config file in /etc (because no-one should be hard-coding their app, even if it's a quick thing) and I'll make some excuse to include the scheduled tasks as there is always an edge case need for them. I won't try and solve user login, I'll just use Persona.

It will be basic, but have a lot of simple components that people can delete out or extend depending on what they want to do.


Do you do i18n ? Other than that, seems to cover everything ! Cheers


Hah, not yet... this is really quick prototyping through to deployable something.

Once I've put it up, I'll accept pull requests... I'm sure there's enough people with small reqs that it could be knocked into shape enough to show how to do most things.


Sure, let me know when you put it on github. thanks !


Completely agree. Im using Go a lot an its just a very nice language for the web (wonder why). I also use web.go. Which for me is very like flask/bottle. Ive found that a web app in go is very simple, fast and downright easy to build. Note that i currenly use webfaction to deploy Go apps. It works very well. If anyone wants to knkw more, just shoot me an email. Ill introducd you


Interested in the sample app as well since I was looking for examples like this.


Would love get my hands on your sample app :)


knocking one up is the best way to clone


Yes, please.


For lightweight in Python, I started on Bottle, but found Flask to be more to my liking for very small projects/web services.

Mostly Django here; if you know the framework well, most things are very quick, but I wouldn't particularly call it "streamlined." Plus that up-front time to get to know it might disqualify it, and lightweight it definitely is not.

My Ruby friends tend toward Sinatra for small projects.


Please note Flask isn't only for very small projects/web services.

Seriously, Flask can be used for huge projects too.



Do you have any good examples? I'd like to try Flask, but the only examples on the flask site are very, very small sites, and don't help at all with learning to structure something larger.


https://github.com/mitsuhiko/flask/wiki/Large-app-how-to

Please note, flask code is easy to read, and you can change anything you want. Flask will not limit you, you can be sure in that.


FLask is my go-to choice as well, the one I write before the write (that was never written so far).


*the one I write "before the rewrite"


Another vote for Meteor. To me, it looks the most promising for a full JS stack framework for prototyping and rapid development.

As with all things though, what's new and edge may not necessarily scale or be supported in the long-term so caveat emptor (I think we need a developer specific latin phrase here). Once a service/site has become successful, key considerations such as community, active development, roadmaps, extendability etc. become paramount.

For those, you really can't beat some of the time-tested communities around PHP (Symfony/Cake), Python (Django/Flask/Bottle), Ruby (Rails/Sinatra) and Java (Spring).

I'd say that Node.js is entering this space from the backend perspective, but the front-end JS frameworks are an open battlefield right now (which is awesome, just fragile).


MEAN - Mongo, Express, Angular, Node

I like it because I get

- high responsive / low latency sites

- fast ramp up time thanks to Mongo, no schemes, no migration, just JSON everywhere; JS objects are one of the most flexible data types

- more than just a key value store, a powerful document store with query capabilities close to SQL DBs (Mongo)

- an ecosystem where performance is important (e.g. tons of on performance trimmed templating engines like doT)

- just one language to get good in (JS)

- fresh, highly modular concept and no aged, outdated design patterns from 2005 legacy, bloated, monolithic web frameworks

- lightweight, lightweight, lightweight

- instant startup time of the VM

- no compilation

- a language implementation with C class performance (V8)

- Easy to find talents which can work on all parts of the system => real full stack devs

- a lightweight, unobtrusive FE framework which doesn't stand in your way (Angular)

- best package manager out there (npm)


I'm tempted to use this stack on a new project but I worry about MongoDB since data in this application is critical and loss would be catastrophic. Is it possible to substitute Postgres or something with atomicity?

Or maybe MongoDB has ironed out the problems that were listed on HN previous...


> but I worry about MongoDB since data in this application is critical and loss would be catastrophic

Don't worry, this is just some old and well debated prejudice against Mongo (don't want to start a mongo discussion here though). Mongo has five different safe write modes you can choose from plus optional journaling and is in general some of the most impressive piece of tech and the best document store I know. Just try it and you won't go back and it's popular: http://www.google.com/trends/explore#q=mongodb%2C%20postgres...


It is possible to substitute Pg, since it has PL/v8 and JSON types, so the 'one language for the whole stack' is satisfied.


Though Postgres is a great DB and supports JSON directly you get just a fraction of the query possibilities you have with Mongo. With Postgres you get some basic operations for the JSON data type (since the JSON support is added recently, think 12-18 months ago). So, I wouldn't consider it as a real substitute to Mongo.


It depends on complexity. This is my python stack:

Simple stuff (API endpoint only, minimal routing, minimal cookie/session related stuff) - Bottle.py

Simple stuff that needs really high performance squeezed out: Wheezy.web + gevent (this category is new. I invented it as an excuse to play with wheezy.web)

Moderately complex stuff (rendering, session, fancy routing): web.py

Complex stuff: pyramid.

I would rather nerf my projects than go to highly complex web stacks.

My Golang stack: Gorilla or plain golang.

Frontend: I am not really a fan of frontend rendering, but if I need to, AngularJS is my preferred framework.

Database part of the stack:

I use postgres for SQL stuff. MySQL is used when there are more people in the team involved. Considering MariaDB for dropin replacement if a team is involved. Still haven't bothered.

My preferred document based nosql database is couchdb. Preferred KV store is redis.

OS:

I used to develop for CentOS but strangely in the past 2 years I have moved on to Ubuntu. Sometimes updates can break things, but I certainly prefer it to the glacial CentOS or Debian


CEntOS should be glacial. That is the point of the EL distriubutions. If you want cutting-edge, that is what Fedora is for.

Servers should not be exciting; they should be battle-tested and rock-solid.


We've moved from the old world of the LAMP stack to one of many different solutions optimized at solving different problems. It is more about the problem, your style and your teams programming background.

As a long time Ruby developer who's always in search of faster, better, cheaper I've found the following:

- Rails is still the safe, moderately fast to develop in do-anything framework. It excels at CRUD and will have a maintained library available for pretty much anything you need to do. It however is relatively slow and Ruby comparatively sucks at anything async.

- Node and its supporting frameworks are fantastic at async and smaller single page type web apps. But it's a bit trickier than Rails or similar to structure and manage larger code bases. NPM is awesome for web development, better than Gems. Packages in general are not as mature as Ruby Gems and will be some time until they are. ORMs are quite weak compared to what you have in Rails (see Mongoose vs Mongoid).

My current stack of choice is Rails+Bootstrap for CRUD, Node+Restify for APIs (or Express if you need to throw in a little HTML as well), MongoDB for the DB, Redis for caching/pubsub/jobs. I'd use Postgres instead of MongoDB if I had an application where data integrity is paramount above all. All the supporting processes like job workers I write in Ruby (Sidekiq is great).

I'd like to use Go and I'm keeping an eye out for an application for it -- something that needs really high performance.


It seems to me that modern web dev happens mostly in JavaScript. The driving reason for this is so apps can be wrapped to be like native apps, and have a level of state and data persistence. The trend in modern web apps is to send a lot of data down as JSON, and only do serverside rendering in cases where you need SEO or incredible rendering speed.

You make a choice between angular, ember, bootstrap+handlebars, roll your own, or a few others. On the back-end, there is a similar array of very reasonable non-real-time frameworks, mostly centered around Python (Django, Flask, etc.), Ruby on Rails, or the newish and sexy and real-timish node.js. Go is apparently pretty popular on HN, and imagine it's not the same academic trap that Haskell is, but I've never touched the stuff. I find Google programming tools to be very good usually (AppEngine, Angular, Chrome dev tools).

Your data store that underlies all of this depends heavily on your application. You can still get plenty of mileage out of MySQL, or Postgres for geo apps, but there is a large community building on top of NoSQL type data stores too.

These are my impressions from having done web dev 4-5 years ago, then focusing mostly on mobile, then having some web projects under my management again recently. The shift to JavaScript became apparent to me when our engineers looked at and chose technologies. I personally was doing a lot of client-rendered Javascript ("web app style") 5 years ago for TrailBehind.com, and it seems like the whole world works that way now, just more high-tech with HTML compilers and templating and more.


Calling Haskell an academic trap ignores tons of wisdom its researchers shared with the world and other languages including Go already incorporated into its philosophy.


If you're looking for some rapid development with Erlang, you've got a few options at your disposal:

Nitrogen Web Framework (http://nitrogenproject.com): Event-driven development. You can do almost complete development in Erlang and writing very minimal javascript or HTML (it's generated by the framework). Nitrogen doesn't provide a database abstraction layer, but Erlang does have database integration which works just fine. You could also use BossDB (below).

ChicagoBoss (http://chicagoboss.org): Rails inspired MVC for Erlang. Has a lot of stuff baked in: BossDB (ORM for a handful of different database servers), mail server, Django templates.

Zotonic (http://zotonic.com): The Erlang CMS. Lot and lots of stuff.

One of the most comprehensive resources for this is the Framework comparison put out by Evan Miller (the maker or ChicagoBoss): https://github.com/evanmiller/ChicagoBoss/wiki/Comparison-of...


There was an old ruby framework called camping. I don't think you can get any more lightweight than that. But it's probably obsolete by now.

Meteor (meteor.com) may not be that lightweight, but it's a really neat model (inherently realtime, no glue code from template to database).

MongoDB (and to some extent CouchDB) are much simpler databases to get started with than MySQL. (No need to write migrations most of the time.) You will need to learn the various ways around the "read-modify-write" race condition nightmare.

For anyone doing any kind of development, I would recommend Vagrant (vagrantup.com). On the surface, it's just a VM where you run your code. But it makes it easy/simple to document your development(/production) environment assumptions, and check them into your VCS.

There are several benefits: All developers will have the same dev environment that mirrors production. New developers (even on different OSes) don't waste any time setting up an environment.


For small projects, try Meteor.

Everything is in JavaScript, and you don't have to concern yourself with such trivialities as database or talking to the server. The recent releases (0.6 onwards) have really easy authentication, and lots of extra packages via Meteorite.


Not a specific answer to your question, but in case you missed it and have interest in the resulting application being quick even on small hardware: http://www.techempower.com/benchmarks/

The associated Github repository is an example of sorts for each framework's code style.


I haven't seen this, so I appreciate it.


Try out Yesod (http://www.yesodweb.com) or snap (http://snapframework.com), if you are, or want to be haskell guy.

Also xkcd uses happstack, another haskell web framework...


Being relegated to php lately, I've been using Silex/Twigg/composer for most of my projects. Silex is built on Symfony2 Components, Twigg is a php port of Jango Templats, and composer is a nice Bundler like dependency manager for PHP.


My favorite lately is Prism https://github.com/socketstream/prism which is a re-write of SocketStream - more modular, flexible. AngularJS on the front-end.


I like my FAM stack;

Flask - run on Pypy for extra speed and great for rapid development of APIs; AngularJS - client side Javascript templating for great single page app; MongoDB - Fast. Schemaless. Returns almost straight JSON to Angular from Flask.

Nginx sits in front, initially serving the HTML page to load the Angular page which pulls its data from the backend API.

Easy to drop in a Memcache/Varnish caching layer and everything can scale effectively.

The isolated nature of VirtualEnvs allows this to be installed on almost any Linux server and to have many different websites running on the same machine.


Did you benchmark pypy + flask? Any numbers compared to cpython?

And whats your whole setup? flask -> pypy -> ?? -> nginx ?


I'm yet to benchmark it but I'll run some ApacheBench and post them up in the next week.

And sorry - the missing link there is uWSGI. Found it to be much more stable and configurable than Gunicorn. Also did some load testing which required a lot of Async stuff (waiting for unreliable external APIs to respond...) and Gunicorn just fell over.


Async with pypy? I though pypy still doesn't support greenlets?

What did you use for async calls?


No mention of Dancer: http://www.perldancer.org/ This is my default and goto. I love it.

I like the simplicity of plain Go, but I have not done much with it yet. It seems quite straight forward and easy to pick up and get going with.

Otherwise, Python Flask is nice as well as Sinatra or Rails in Ruby. I'm not much of a fan of Django, but it's personal opinion. I just don't work well with it, others seem to really dig it. Seems nice otherwise.


Dropwizard in the back, Knockoutjs on the front, looking at angularjs as an alternative to KO.

I think there is much value in a hard separation of backend and frontend. Basically you get an API for free and I believe that most applications can benefit from having one: it helps with integration and migration, scaling and composition of services.

For small hacks, flask. Foundation for the frontend. I worked with Django and web.py, but found Flask and it's ecosystem of plugins a bit more lightweigth.


Haven't seen this mentioned here yet, but Laravel is a great option if you are considering PHP. Laravel 3 is very mature while 4 is just around the corner. It comes with a nice CLI for scaffolding and is very well documented. It also has a nice speed advantage over frameworks like Cake. Laravel + AngularJS makes for really fast development times while creating low maintenance applications.


For Scala:

. Scalatra

. Play + Akka


The Play framework works quite well in Java as well. Although some knowledge of Scala is useful for the template engine, as well as some spots where the Java API abstraction leaks a bit.


My favorite is PHP + Symfony2 + Doctrine (ORM) it just works ! and the best part is that Symfony2 wont let you down if your project is very complex, it seems to me that a lot of the current JS frameworks are not yet mature, thy work well on "Hello world !" examples, but when your project gets complex you will have a hard time.


For quick prototyping I always use:

- CouchDB (DB with RESTful endpoint)

- Spine.js for logic and rendering (with jade for the templating and stylus as CSS pre-processor, with Foundation 4 as CSS lib). Spine.app can generate new projects the same way django-admin.py does.

I code nearly everything in CoffeeScript. This whole workflow/stack has always me started in no time.


For fast development, I like Clojure + Compojure + Hiccup using IntelliJ. If you like Clojure then Hiccup is awesome to use: it is an efficient Clojure library for rendering HTML. A bonus: this combination also provides very good runtime performance. This combination has replaced Ruby + Sinatra in my little world.


Exactly! I just started messing around with Clojure after meaning to get into Lisp for ages now. Mind, blown. With hiccup (HTML), cssgen (CSS), ClojureScript (Javascript) and Compojure (server), you can use one language to write the entire web app from front to back. I'm not saying that this is the right way to do it, but it's pretty neat. It is fast to develop in too, basically you get something like Sinatra/Scalatra/Flask, and BYO-everything else (library support is good, but certainly nothing like Rails or Django).

I didn't realize IDEA had Clojure support, I will have to check that out. I mainly use emacs+nrepl and experiment a little with Light Table.


If you're playing with Node checkout Drywall: http://jedireza.github.io/drywall/

I'd really like to know what people think. Collaboration and feedback are welcome.


Deploying Sinatra to Heroku is pretty darned fast and convenient (if not particularly economical at scale). I don't use Padrino on top of Sinatra, but I'd imagine that it would be just about as smooth.


Does anyone has experience with Caspio [1]? This claims to allow making sophisticated web applications nearly entirely with a GUI.

[1] http://www.caspio.com/


Play 1.x with Java works well for medium to large size applications. It's stateless architecture gives you the performance you need. For small projects, I like to use Flask.


Flask is written in python and is very easy and lightweight.



Flask is awesome for sure.


My favorite at the moment is: AngularJS, Angular UI bootstrap, express.js or Scalatra for backend, mongoDB, TypeScript. WebStorm IDE.


CompoundJS for Node.js — it is very streamlined, and is in active development, although some of the docs are not yet updated.


My favorite at the time is: Backbone.js — nginx — rails — postgres — debian — linode server


Here's ours:

- django - nginx - uwsgi - postgres - arch linux - linode server


Out of interest - what made you go with Arch?


Ramaze.


Ruby on Rails, Django


sinatra




Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: