Hacker News new | ask | show | jobs
by chatmasta 3596 days ago
Years ago I learned to code in PHP/MySQL, never really using a framework. I made some attempts to use CakePHP and Symfony but never liked them much.

When I wanted to build my first big project, I looked for something like Rails in PHP but couldn't find anything. I did find Django, though, which looked cool. Since Python was more similar to PHP than Ruby, I learned Python and used Django.

Eventually I found Django too heavyweight and "batteries included" for what I wanted, so I moved to Flask.

Flask is awesome and if you like Python I still recommend it. But I think it gives you too much flexibility and there are too many ways to do one thing. Also, Python does not strike me as a language well suited to the web, primarily because everything is synchronous.

I'm now building a web app with expressjs, which has all the benefits of flask (minimal, include modules as you need them) with better defined best-practices and a larger ecosystem.

I'm using parse-server as the backend. At first I hated parse because of vendor lock-in, but now that parse-server is open source, that argument is moot. Installing it on my own server is very easy.

The best benefit of using parse-server is how easy it makes building components in different languages. Because there is a parse client library in almost every language, you can write each component of a project in the language best suited to do the job.

For example, the web app I'm building is an express server that talks to parse. But the billing and invoicing portions of the code, which happen mostly in background jobs, are all Python. They talk to the same parse backend as the web app, complete with all the beforeSave/afterSave triggers and cloud code functions.

Building the web app has been very fast because of built in functionality of parse server like email confirmation, forgot password, etc.

Building the billing code has been enjoyable because I'm more comfortable with Python, and I can offload any consistency worries into beforeSave/afterSave triggers and cloud code functions. This way the web app and Python code can call the same logic.

Having used many others, I would highly recommend this approach.

1 comments

I spent nearly 15 minutes on the parse website but still can't figure out what it does. All I see is that it's an open source version of the Parse API. But what is the Parse API?

Since you've used it before, would you care to elaborate on what the Parse API does?

They were originally "backend as a service," basically a smart layer over mongo. They charged pretty obscene rates per request, but now it's all open source so no worries about that.

They provide a nice dashboard for creating Mongo collections (which they call Classes).

You write "cloud code" in JavaScript. You can write beforeSave and afterSave functions which are triggered before/after you save a document. You can also write "cloud functions" which execute within parse-server and interact with the database.

The result of this is that you can perform a lot of heavy lifting and consistency logic in one place, "the cloud." That way you can build clients in multiple languages (like an iOS app, Android app, web app) that only need to worry about their platform specific details.

Their original value prop was for building mobile apps, but since the ecosystem is pretty mature with a client in every language, I find the benefits extend to writing multiple clients for any purpose.

I'm curious: did you consider using Flask as a back-end, instead of parse-server? Is parse-server just easier than coding your own API back-end with Flask and whichever db you like?
No. That would effectively mean reimplementing all the logic of parse-server in flask. And when I was done doing that, I wouldn't have a client library in every language ready to interact with my backend.

Parse-server is definitely a faster way to start because it's already an API layer in front of the database.