Database scalability
Nuno Peralta & João Proença
I. INTRODUCTION
Every day, Internet is growing and everyone is switching over to online services. Therefore, there must be methods to support the large traffic that big websites, such as Google, Facebook and Microsoft, get every second. As the users keep growing, and database as well, the server will start having issues with its resources. MySQL server, connections, system backups, CGI scripts… everything is using Memory and CPU. Downtimes will begin and headaches too. We’ll be talking about some database scalability methods that the biggest websites use today. While new approaches are being implemented by them, at the same time they are collaborating with the services that small companies’ servers use. Facebook helps on the development of MySQL, PHP and Memcached [1].
[1] Facebook (Jan 2012). Open Source - Facebook Developers. https://developers.facebook.com/opensource/
II.
NON-RELATIONAL DATABASES
MySQL is a relational database and is designed to be used as a relational database. So, because of that, it is relatively slower than a non-relational database. MongoDB is a non-relational and NoSQL database, it is a document-oriented storage [2]. This doesn’t mean that one is better than the other, because MySQL and MongoDB are designed to different purposes, and will perform better on what they were designed to. MongoDB’s “inserts” are much faster than MySQL’s, because MongoDB inserts all data in the RAM and then will periodically flush data into de disk (unless the “safe” flag is set to true; if so, “inserts” will be a little slower, but still faster than MySQL) [3]. Inserting data in the RAM rather than directly on the disk is not always the best option. Suppose that, after you insert all the data you want, the system crashes. You will have data loss, because all the RAM data was lost on the next reboot, and you didn’t save the data into the disk. MongoDB, which is non-relational and is faster with the