As a part of backend for an Android Application, I was looking for decent technology to build a REST API to be consumed by the Android App and in the Future by the iOS App too.
First I tried using Flask which was fine, but after some time I was really reinventing the wheel because for different models, I was doing the same thing, GET / POST / PATCH/ DELETE, it did not feel right, this should be way more easy, since yes there are some times side effects and other behaviour that you expect from your REST API.
A REST API is manly it is a CRUD system that is tweaked lightly if you like. I stopped working on the Flask backend, and started looking for some tool that will help you remove the boiler-plat work.
I found Eve, this thing is really helpful, it is way much faster to setup an API in less than 10min, sure if you want to go beyond you have to read the hole doc again and again and ask in Stackoverflow (the main developer will respond to your question :D).
This framework will help you save a lot of time comparing doing things on your own, certainly if you want to add something that is not supported it will not be as easy as doing it with your own code, but this uses Flask for the underlaying endpoints so adding features or tweaks should be straight forward if you are comfortable with FLask.
The architecture that I ended up using is this way:
- Python Eve:
- REST API
- AsynTask with backend mongoDB
- Authentication revoking
- User throttling
Python Eve, comes with MongoDB out of the box, you don’t even have to add the collections on your own, it will create them when you request POST on the collection name.
If you want to get the best of this framework, you should:
- Setup mongoDB (or other database backend) on your own, use indexes.
- Use an AsycTask worker (like Celery) for blocking requests.
- Use other file storage system, other than GridFS (Like S3 if your on AWS)
- If you don’t need Document version, disable it.
- Don’t disable schema validation, otherwise you will end up with unmanageable documents.
So far I am able to build all the feature I planned with Eve, but I started using it recently, so …