Are databases attached to dynos in heroku?

I want to try out heroku, but am not quite sure if I understand all terms correctly.

I have an app with node.js and redis & my main focus is scaling and speed.

In a traditional environment I would have two servers in front of a load balancer; both servers are totally independent, share the same code and have an own redis instance. Both servers don't know of each other (the data is synched by a third party server, but that is not of interest for that case).

I would then push a load balancer in front of them. Know I could easily scale, as both instances are not aware of each other and I could just add more instances if I wish.

Can I mirror that environment in a dyno or can't I attach a redis instance to a dyno?

If something is unclear, please ask, as I'm new to paas!

As I understand it: I would have a dyno for my node-app and would just add another instance of it. That's cool, but would they share the same redis or can I make them independent?

You better forget traditional architectures and try to think it this way:

  • A dyno is a process processing HTTP requests, the absolute minimum of an app instance on heroku.
  • For one application instance you can have as many dynos you want and it is totally transparent . No need to think about servers, load balancing, etc... everything is taken care.
  • A redis instance is a basically a service used by the application instance and therefore by one or more dynos. Again, servers, load balancing, etc all is taken care.

Maybe you want to review the How it works on heroku.com now again.

You can have as many dynos for one URL as you want - you just change the value in the controller. This is actually one of the best features of Heroku - you don't care about servers, you increase the number of dynos and by this increase the number of requests which can be processed simultaneously.

Same thing with redis - it basically doesn't work that you add instances, you just switch to a more performant plan, see https://addons.heroku.com/redistogo. Again, forget about servers.