
Аннотация
When I released The Hacker’s Guide to Python in 2014, I had no idea that I would be writing a new book so soon. Having worked on OpenStack for a few more years, I saw how it is easy to struggle with other aspects of Python, even after being on board for a while.
Nowadays, even if computers are super-fast, no server is fast enough to handle millions of request per second, which is a typical workload we want to use them for. Back in the day, when your application was slow, you just had to optimize it or upgrade your hardware – whichever was cheaper. However, in a world where you may already have done both, you need to be able to scale your application horizontally, i.e., you have to make it run on multiple computers in parallel.
That is usually the start of a long journey, filled with concurrency problems and disaster scenarios.
Developers often dismiss Python when they want to write performance enhancing, and distributed applications. They tend to consider the language to be slow and not suited to that task. Sure, Python is not Erlang, but there’s also no need to ditch it for Go because of everyone saying it is faster.
I would like to make you aware, dear reader, that a language is never slow. You would not say that English or French is slow, right? The same applies for programming languages. The only thing that can be slow is the implementation of the language – in Python’s case, its reference implementation is CPython.
Indeed CPython can be quite sluggish, and it has its share of problems.
Every implementation of a programming language has its downside.
However, I think that the ecosystem of Python can make up for that defect.
Python and everything that evolves around it offer a large set of possibilities to extend your application, so it can manage thousands of requests simultaneously, compensating for its lack of distributed design or, sometimes its "slowness".
Moreover, if you need proof, you can ask companies such as Dropbox, PayPal or Google as they all use Python on a large scale. Instagram has 400 million active users every day and their whole stack is served using Python and Django.
In this book, we will discuss how one can push Python further and build applications that can scale horizontally, perform well and remain fast while being distributed. I hope it makes you more productive at Python and allows you to write better applications that are also faster!
Most code in this book targets Python 3. Some snippets might work on Python 2 without much change, but there is no guarantee.
Комментарии к книге "The Hacker’s Guide to Scaling Python"