The importance of a scalable database

Fin Carew 18-Sep-2017 12:34:48

The importance of a scalable database

When a DBA refers to scalability, they’re referring to the flexibility your database has to expand. This can be done in one of two ways: vertical or horizontal. Scaling vertically refers to adding a greater capacity to a single machine, which could mean more memory, a more powerful CPU core, or more RAM for an existing server. Horizontal database scalability, on the other hand, refers to adding capacity with more machines. Adding more machines is a good long-term solution because you are free to add more servers as and when you need them. Both Oracle and SQL servers are designed to allow for scalability, although have different ways of going about it.

However, it’s worth remembering that some database setups do not accommodate horizontal scalability. That’s just one of the reasons you need to consider scalability when you’re building your database or migrating to a new one. Unless you don’t expect your business to change size in the future at all (which is an odd expectation), having a plan for a scalable database is essential, and there are two big reasons why:

You can accommodate for changes in demand

As the name suggests, a scalable database means your database can grow at the same pace as your business. That means you’re never left in a situation where you lack the resources to operate at your full potential. What many people forget – and what an observant DBA will be able to keep track of – is that you can also scale down as well as up (not at the same time, obviously). A business might want to scale down if demand decreases or they need fewer resources, and doing so is important for reducing operational costs.

Scaling up isn’t necessarily as simple as analysing your current demand and accommodating that number. There could be a spike in data very quickly and, while this is good news for the business, it can cause problems if there isn’t a plan in place to expand your database very quickly at short notice. At DSP, we make sure that scaling your database up or down is as simple as asking and we’ll keep you fully informed on the status of your data in our regular, automated reports.

You will understand bottleneck issues

If your database starts performing at slow speeds, it’s possible that there is a data bottleneck problem. This is most commonly caused by high CPU usage and can be a sign that you need to upgrade your server. High CPU usage could also mean that the operating system is consuming more than its CPU share and you need to address the software in your database. Alternatively, poor CPU performance could be caused by the CPU having to wait on the input/output subsystem.

CPU usage might be the most common cause of slow performance, but close behind is low memory. When you start to run out of physical memory (RAM) on the server, the database will typically start to use the hard drive to store mission-critical processes that are usually held in RAM. The problem with this is that RAM is about 100 times faster than your hard drive, so when the hard drive is in use, data is sent and received incredibly slowly. Usually, to fix this problem, you would need a RAM upgrade but there’s a chance that this could be the result of a memory leak, which will need identifying and patching. A memory leak is the result of a bug that means a program doesn’t return memory that was allocated to it on a temporary basis. You would need an experienced and meticulous DBA to identify a leak, or you can prepare for it by using an operating system that provides memory leak detection.

Lastly, you could be experiencing bottleneck issues due to high disk usage. If you’re asking too much of your disk, you could upgrade for more efficient performance, but a better and longer-term solution is to scale up your database.

Despite us spending this entire blog explaining why scalability is essential, it’s advisable that you look for alternatives before you decide on a scaling solution. At DSP, our DBAs know how to fine-tune your server to keep it working at maximum efficiency, so it’s always worth trying to take non-scalable performance-optimisation steps before settling on scaling up or down. That said, it’s still very important to have a plan in place, understand your options, and realise what those options might involve. You don’t want to decide you need to scale up when it’s too late, leaving your database operating insufficiently. Get in touch via our contact page and let us know if you have any questions – we’ll be glad to help.