Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a trade-off between performance and scalability? #284

Open
JamesYu608 opened this issue May 19, 2019 · 1 comment
Open

Is there a trade-off between performance and scalability? #284

JamesYu608 opened this issue May 19, 2019 · 1 comment

Comments

@JamesYu608
Copy link

JamesYu608 commented May 19, 2019

https://github.com/donnemartin/system-design-primer#performance-vs-scalability

Does a system have to sacrifice performance for scalability?
Even if I read the sources, I still can't get it.
Why is there a trade-off between them?

Thanks in advance

@morenoh149
Copy link
Contributor

morenoh149 commented May 20, 2019

Take for example database isolation levels (http://highscalability.com/blog/2011/2/10/database-isolation-levels-and-their-effects-on-performance-a.html) in a perfect world we would like to perform all operations on a database in a serial way. That is, operations happen in order as they are received by the engine. However in practice no production-level database performs operations in a serializable way, we make compromises and figure out ways to perform operations a bit faster. In this way we trade off performance (expected operation side effects) for scalability. See https://www.youtube.com/watch?v=5ZjhNTM8XU8 to learn more about attack vectors on database isolation levels.

Another way is if you wanted to scale some api. Say you have a stock exchange engine running on an api. At first you run it in one location (part of the world) and the performance is fast. But then you start getting customers at the other end of the world and their latency numbers are bad (due to the speed of light and timespace). If you choose to spin up and api instance that is geographically closer to those customers (scale), the latency is shortened for them but now your apis must synchronize between instances. This synchronization will cost you time and extra computation steps, lowering your performance.

We tend to see this trade off in various forms at various levels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants