Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it better to have multiple databases vis-a-vis multiple instances on Amazon RDS?

I am planning to deploy my web application (ASP.Net based) on the Amazon EC2 and the persistence on Amazon RDS. I have a 'gut feeling' that at least my session store (again on RDS) should be separate from the rest of the application database. This is because I am expecting high activity in the session store.

RDS supports the ability to create multiple databases on single instance. However, I would like to know if it would be wise to take a separate instance or whether a separate database is good enough. I know that it is somewhat pre-mature to expect such a scalability need, but this is more from planning perspective, because it may disruptive to switch the session state server for a running application later.

Further, 1 more point to note is that having 2 small instances looks to be cheaper that scaling up a small instance to a large (it is 4 times to be precise). And to finish, are there any recommended practices already available for planning (for cloud database)?

like image 358
Kabeer Avatar asked Nov 06 '22 18:11

Kabeer


1 Answers

I would investigate other possibilities for session storing, eg. memcached or similar type of in-memory storage. However, if you absolutely must store sessions in a real database, then having two databases on the same instance is not at all different than having a sessions table right next to your data. The problem with database store is the heavy network request cost for each and every page view (retrieve and then store session back), not the placement of the table.

As for larger instances, they are not only better because they have more memory to fit larger datasets but, importantly, they have much better network and disk I/O. So, even ten small instances would not save you from a I/O bottleneck at one of them.

like image 68
kibitzer Avatar answered Nov 15 '22 05:11

kibitzer