That is more than possible. But putting all that on one droplet can get messy. I recommend you break it up into web and DB. But you can put it on one droplet, that is totally up to you. For a web server to pass a request to a different backend based on the URI, you can utilize Nginx’s location blocks. These let you define rules based on the URI. You can take a look at this tutorial for more information.
As for droplet size and such, that all depends. How efficient is whatever you’re running (If you are running two different DB backends, you already need quite a bit of ram unless you really tune that), how many requests/traffic do you expect it to hold up to, and how redundant do you want it to be? There are a lot of determining factors so that question cannot go answered without more information of your setup and such.
Nginx is one of the most popular web servers in the world. In this guide, we will discuss how Nginx selects the server and location block that will handle a given client's request. We will go over the algorithm in place, as well as the directives and options you can use to modify the selection process.