A Tale of Two Intersecting Quality Attributes: Security and Performance

I want to build a system that is highly secure, scalable, reliable, performant, compliant, robust, resilient, and durable.” Add more adjectives to that to really dream of a quintessential solution. Is that even possible? Where do we make the two ends meet — aspirations vs reality? What is the right intersection point? To answer that, we probably need to categorize the above, and maybe a few more quality attributes, into two major cross-cutting concerns — security and performance, and see where and how to strike a balance between the two, often referred to as architectural or design trade-offs.

Security is a requirement for each and every component involved in the overall system, which may include devices, networks, data, services, applications, storage, etc. However, it is not always mutually exclusive in the sense that the security of one component can partly or fully ensure the security of other components, depending on how they are configured. For example, we often offload SSL at the gateway level as the data is expected to travel within the internal network after that, which is deemed secure to a certain extent. Likewise, the performance of the overall system depends upon how each individual component is behaving. We may have a fast rendering UI but a slow API response that really sucks, or vice versa.

It is often not possible to address the security and performance concerns in isolation as one impacts the other. For e.g., we may want end-to-end encryption of requests as they traverse the system for higher security but that may impact the performance as we would need to do decryption and re-encryption at different stages to extract required parameters (e.g., tokens). We need to identify that right intersection point in order to strike the right balance between security and performance. For that, it is important to look at each individual component and identify what security and performance mean for those individual components. There is no set way, and it really depends upon the non-functional requirements identified for the product.

While performance is critical from a user experience perspective, the need for enhanced cyber security has become much more pronounced given the increased surface area of attack as a result of a distributed yet connected ecosystem. Though we have to consider security and performance at the component level, we can have a broad categorization as defined below.

Security

Data Security

Data Security refers to data to be secured based on its state. Data could be in transit, could be at rest, or could be in use by applications.

Data at Rest

Use cryptographic algorithms to encrypt data at rest, which can only be decrypted using the key. Apply role-based access control to data to prevent unauthorized access.

Data in Transit 

Use SSL/TLS with CA certificates to encrypt data in motion and avoid any interception and unauthorized access. Use secure communication protocols such as HTTPS, SSH, etc.

Data in Use

Use fine-grained access control to protect data in use. Mask sensitive data while displaying and avoid storing the same in memory for a long duration.

Regulatory Data Compliance

Network Security

Application Security

Device Security (in IoT scenario)

Performance

The above is not an exhaustive list of security and performance considerations. The key thing is how to establish the balance between the two because improving one of them could adversely affect the other. E.g., as we try to increase the network security, the traffic is checked before moving further, which may impact the performance. Similarly, encryption and decryption are an expensive operation both in terms of time and cost. Do we need to secure every piece of information/data? It’s often not easy to find that sweet spot. However, a methodical approach, weighing both functional and non-functional requirements, can get us there. Below are a few high-level guidelines (not exhaustive, though) we may follow:

While I have talked about the balance between security and performance, cost is another major attribute that directly gets impacted by the choices we make around security and performance. This leads us to a golden triangle (Security, Performance, Cost) from architectural standpoint, similar to a golden triangle (Scope, Timeline, Cost) that we have on the project management side.

 

 

 

 

Top