1

I am building a web/mobile application with Django Rest Framework (DRF) that enables authenticated users to post snippets and/or vote for other user's snippets. All users (authenticated or not) can also get the list of recent snippets (paginated, ex: 5 per page). Snippets, users and votes are stored backend in database.

I'm totally new to serverless architecture so I'm asking the question: is this application a good fit for this kind of architecture? Obviously, my DRF application is built around Web REST APIs which seems to be at first glance a good fit but the authentication part of users and paginated list of snippets let me think it could not be the case.

Can someone enlighten me?

1

As opposed to serverless, you might be thinking of a microserver architecture.

In either case, you break up the API into smaller pieces. For example have a micro server handle all authentication and authorization requests. So if you have another microserver that returns a list of items specific to a user, you need to call the authorization micro server from the list micro server. Lambas would work in a similar manner.

You could use Django for each microserver. It is also common to use Flask as well. You will need a separate data store for each microserver. However, I am under the impression that Django is not typically used to implement Lambdas.

If you are considering going the microserver route, you might also consider a container service to develop/deploy your micro servers. Something based on Kubernetes like OpenShift.

2

'Serverless' is supposed to save you money by running your app via AWS Lambda or similar PASS hosting arrangements.

You pay per api call rather than having a server running 24/7

If your app is called only occasionally then you will save money. But if you app is in constant use you are probably better off with a normal server.

Its a bit more complicated than that, as you will need other things like IP addresses and databases. Really you need to try it both ways and see which is cheaper.

  • Thanks for your answer @Ewan, more useful than these non constructive downvotes! But how do you address the authentication and the pagination processes with serverless architectures? – Patrick Jan 1 '18 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.