Ask HN: What's your go-to back end for simple projects? - rwol
======
Brainix
Flask! It's Pythonic and good. Once you've done a couple of Flask projects,
you can spin up a new microservice in a couple of hours. It's much lighter
weight than Django, so it forces you to keep fewer moving parts in your head
while hacking.

[http://flask.pocoo.org/](http://flask.pocoo.org/)

Lately, I've been using Flask on the back-end, and React on the front-end.

~~~
PostOnce
I keep thinking I'll learn Django, but I hate Django, why would I want to
build a skill that I'm then forced to use, as well as proliferating the market
for Django products?

I work on Flask stuff on purpose, because it means in the future I'll have
more Flask work...

Flask is much more pythonic than django.

In fact, go look at Django's website/documentation, they don't have a hello
world or a quickstart, they have like a 10-page tutorial to build some
frankenstein nonsense, Flask's homepage has a 5 line application! That's how
Python is supposed to be.

The more flask in the world, the better.

edit: now I've read some other people here saying Django gets easier after you
use it, or it's gotten simpler... Flask is easy the first time you use it, and
it's always been simple. Pythonic. End rant.

~~~
tedmiston
You could write Hello World the same way in Django with nothing more than one
route and one view. However, the Django tutorial is longer, I think 6 pages,
because it provides so much more out of the box. The Flask tutorial would be
the same length if it covered topics like a variety of views, templates,
serialization, SQLAlchemy, migrations, model design, etc.

Flask actually has a tutorial just like this in the docs [1].

I think you should give Django a chance to be able to compare the two
frameworks in these kinds of aspects.

[1]:
[http://flask.pocoo.org/docs/0.11/tutorial/](http://flask.pocoo.org/docs/0.11/tutorial/)

------
patrickgordon
Rails.

You get lots of great stuff out of the box. Perfect for me to get up and
running quickly for simple/side projects.

Writing Ruby feels nice and is always a welcome change of pace from a lot of
the heavy JS stuff I am doing on frontend atm.

~~~
herbst
+1 for Rails.

When i have a new idea it takes me at max a hour to have to complete framework
up and standing (Bootstrap/UI, User management, Databases, Deployment, ...)
and i can start working on business logic.

------
techdragon
Django

Good solid base for quickly developing something quickly.

Iterating on a database schema has never been easier since 1.7 the migration
tools are built in and the ecosystem of plugins has lots of tools that make
development of a prototype extremely easy. It just keeps on getting better,
just the other day I found an plugin to automatically generate knockout.js
powered AJAX forms without me having to write any of the JavaScript.

~~~
sparky_
w..what plugin is that? I need that!

~~~
michaelmior
Presumably django-knockout

[https://github.com/AntycSolutions/django-
knockout](https://github.com/AntycSolutions/django-knockout)

~~~
sparky_
Thanks!

------
oblib
I guess I'm old school. For simple projects I still use Perl with CGI.pm and a
flat file database that stores data in CGI.pm's "name=value" format in a text
file.

If I need templates I'll add "HTML:Template", for email I'll add
"Mail::Sendmail", et cetera, to my perl cgi script.

~~~
stevekemp
Nice to see more Perl here.

I too use Perl for most applications. These days I mostly use
CGI::Application, which is great, although I've started to experiment with
using Dancer (which is kinda like Ruby's sinatra framework) with success.

------
DigitalSea
Google Firebase.

As a front-end developer I just can't warrant the time setting up a backend,
setting up a database, defining routes, handling authentication and the other
nonsense that seemingly takes a solid day to get working.

Firebase to me is the best choice for simple projects, I don't use anything
else anymore.

~~~
tedmiston
As a mostly back-end developer, I'm still a fan of Firebase as well for the
right projects. I haven't used it since they were acquired but the free tier
still looks pretty generous.

The only downside I really see is once you leave the free tier you're at $25 /
month minimum whereas I can run a small backend (or multiple small backends)
on a $5 / month box. The difference really adds up if we're talking multiple
small projects for multiple years.

------
ianamartin
Pyramid and Postgres on the backend, Mako templates w/bootstrap on the front.

When I'm prototyping, my data model is stored procs that return json
structures to the templates. I use SQLAlchemy core to connect to the db and
execute the procs.

A prototype like this is super fast to get running, it gives you a really
clean app structure that you can hand off to pretty much anyone and have them
work on features, if you're lucky enough to have a team. If not, it's pretty
easy to keep it all in your head at once.

As things grow, you can replace components as you need to.

You start off rendering JSON anyway, so if you need a more advanced interface
up front, you can use React or Angular or Ember to hook into the data model.
Whatever you want, really.

If things get more complex on the backend first and you need more structure
there, you can refactor the SQL (because it was probably really gross the
first time you wrote those "dump everything" procs). If you end up with a
really complicated data model, you may have to eat the performance hit and
switch to Alchemy proper for maintainability. Either way, the choice is yours.

Sometimes the simple app is the one you need, and the biggest challenge is
scaling quickly. That's easy too because the database handles transactions
inside the procs. Run one instance of the app per core on your server and put
them all behind nginx and repeat on as many machines as you need to cover your
traffic needs behind HAProxy. Now you're maximizing multi-core performance per
machine without having to write async/await code.

It's probably not for everyone, but I find it gives me an enormous amount of
flexibility, scales well in every sense of the word, allows the app to develop
organically, and has very few drawbacks.

------
yegortimoshenko
Clojure and Elastic Beanstalk.

You take an arbitrary Ring-compatbile HTTP server, write a handler, and glue
together whatever you need to. And you most likely don't need a routing
library, you can just use an array-map for that. When it is time to deploy,
you create a jar that contains your whole project and upload it to AWS.

Rollback is easy, too, as you don't overwrite your previous version. Funny
enough, it means you can treat versions as immutable values of your
application over time. I use yyyymmdd for versioning in most projects, that
works great with this approach.

There are many discussions on virtues of Clojure's dynamic development
environment, so I'll skip that.

------
tedmiston
Django.

The ORM is really usable and simple CRUD apps are pretty easy after you've
used it a few times. Django Admin for free is nice too.

~~~
gt2
For those using Rails, rails_admin and activeadmin gems provide a similar
admin for Rails models.

------
kornakiewicz
The language you know the most would be best fit. Maybe Python/Rails/Go could
be most optimal fit, if you know very good Java or PHP and don't want to waste
time on learning something new - stay with that.

~~~
rwol
I'm familiar with Java Servlets and Express for the middle-layer. I've yet to
set up a database from scratch, but I've worked with MySQL and Oracle SQL
databases before. It'd be cool to learn more about setting up and scaling a
database (though I doubt I'd need much scaling for my side-project for
awhile).

------
aMayn
Mojolicious. ( [http://mojolicious.org/](http://mojolicious.org/) )

I am a sysadmin. I like Perl and its plethora of modules. With Mojolicious, I
can write a simple web app/prototype within the hour.

------
taurath
Node/Express for web projects. Simple plugins for everything I'd ever want.

------
eb0la
Just PHP and MySQL. I coded a simple back end for a web app 10 years ago with
very simple templates. Runs fast as hell and I don't need any API
documentation or dependencencies or whatever.

------
rbalsdon
C. Why the hell does everything have to be a web app?

~~~
jklein11
Why the hell can't C be in the web?[1]

1.[https://medium.com/@lucperkins/web-development-in-c-crazy-
or...](https://medium.com/@lucperkins/web-development-in-c-crazy-or-crazy-
like-a-fox-ff723209f8f5#.sttthdkqi)

~~~
amorphid
One practical reason is that I suspect most C developers aren't interested in
building web applications. And most web application developers don't know C.

~~~
flukus
I think that's a terrible thing. I've been a web app developer for most of my
career and I'm not super fluent in c anymore. But c is one of those
foundational things every developer should know.

------
skybrian
Go with App Engine. There is a free tier and I've had projects running there
for years.

~~~
sathishvj
Same here. Easy to setup projects. Quick to deploy. Focus on the app instead
of administration. Go+AppEngine has a lot of my projects - no cost, no
maintenance. Of course, if by any chance those projects grow, I'm still likely
to run it there.

Small hope/suggestion: I wish there was a free tier on Cloud SQL.

------
GFischer
ASP.NET deploying to Azure, if you're into the ecosystem it can't get much
simpler than that (a web page up an running in minutes).

It's now cross-platform and there's an Azure free tier.

Of course, other people can get similar productivity within their own most
familiar stacks :) (someone mentioned an hour for a similar setup with Rails)

------
skrowl
ASP.NET web API. It's amazingly simple and fast. With .NET Core it even runs
on Mac & Linux now.

------
alexgaribay
Elixir with Phoenix. I can spin something up very quickly and have it deployed
on Heroku.

------
doktorjeep
AWS Lambda functions and some kind of database. Lately that has been graphene.
AWS SWF, SQS, SNS added in the mix allow me to POC distributed apps quickly.
Finally, I've worked with API Gateway recently when needing to support mobile
devices.

------
flukus
Dotnetcore, mainly because I'm a .net developer by day.

Going to give crystal a go for my next project though.

------
nicomfe
Im using firebase as well, it is pretty easy and good enough for a small
project

------
beemboy
Java frameworks are conspicuous by their absence. Are there any lightweight
Java frameworks for the java/android folks out there?

------
antoaravinth
Grails! If your like me (into Java world), then Grails is the right choice.

------
wallawe
Stamplay has been awesome for me as a front-end dev to get things up and
running quickly. Rails is great as well, esp if SEO is a consideration.

------
ajeet_dhaliwal
Node/Express, I love me some JavaScript.

------
schmidty
Nancyfx

~~~
skrowl
Great stuff but .net core copied most of its best features. You can make a
very light self hosted web API without IIS now.

------
milankragujevic
apache2, php7.0, mysql-server, libapache2-mod-php7.0 and php7.0-mysql.

Yes I'm not cool :P but when did I care about being cool...

~~~
milankragujevic
As the framework, it's CodeIgniter or for ultra-simple projects Slim,
templating engine is Mustache, and hosting platform is nginx reverse proxy +
virutal machines with NAT on a dedicated box at OVH.

------
himanshuy
Spring-Boot.

------
leemalmac
Node(Express) or Python(Flask) backed by PostgreSQL/MongoDB. Love both.

------
cliffcrosland
Luminus - compilation of Clojure libraries for web dev. Postgres.

------
ravenstine
A Node.js skeleton, Express and/or AWS SDK, and PouchDB.

------
ojiikun
a few lines of self-serving perl with SQLite for really simple stuff.
ninjaframework with MariaDB for everything bigger.

------
navyad
Django, really easy get started with.

------
ruairidhwm
Laravel :)

------
wprapido
PHP + mySQL / mongoDB

------
pizza
bottlepy

