3 ms·
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 t
by ianamartin 10y ago
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.