I’m working on a dashboard that’s been growing and it’ll keep growing. For the dashboard I perform some calculations that are sometimes computation-intensive. My app is deployed on Heroku, which gives 500MB RAM and it’s not enough right now. So I’m thinking there must be a way to perform my calculations in another service (AWS Lambda?) and make my app connect to an API, reducing the use of RAM inside the app.
I’m not sure if this is the place to ask, so please refer me to a better place if I’m wrong here. Is there are recommended way to do this? I don’t come from a software engineering background, so this is all pretty new ground to me, any help would be appreciated, thanks !
I think that needing much RAM and being computation-intensive are two different things, but it may be that soon you’ll need both: more RAM and more CPU power.
I am not an expert on this, either, but what I start thinking when using Heroku+AWS Lambda is that you would have to basically always also send the data Heroku -> AWS, and then, when it is ready, AWS -> Heroku. If speed is any of your concerns, maybe it is good to have the data and computation in the same place?
I have tried once the AWS EC2, which is basically a Linux (or Windows) virtual machine, into which you can have remote connection, and in which you may run your webserver. There are many different pricing plans for different needs. Needless to say, it might get costly fast, but I don’t know if there are cheaper ways to run a real application on a webserver (after you grow out from the free services).
Of course one aspect to possibly reduce costs (CPU or RAM usage) is to try to optimize the code. This has obviously also a limit after which is does not save your money, either.
Thanks @np8. In the case of using EC2, this would be a replacement of Heroku? Would I then connect EC2 with AWS Lambda? Should it be faster if I’m connecting two Amazon services? Sorry if I’m overwhelming you with questions
Yes that’s why I would rather use EC2. Note that you might be able to just use your EC2 instance to make any calculations if you wish. You can think an EC2 to be “almost like a regular computer”.
The AWS ecosystem is quite versatile so there is a service for almost any kind of situation. But there is also really much to learn if you want to use all the cool things it has to offer (+everything costs something). So my advice would be to start small and see what your app reallly needs.
For AWS Lambda vs EC2 comparison you might be interested to read this: