Databases Reference
In-Depth Information
do support multiple threads on multicore CPU s, the languages and their libraries were
created before NoSQL and horizontal scalability on multiple node clusters became a
business requirement. In this chapter, we'll look at how organizations are using lan-
guages that focus on isolated data transformations to make working with distributed
systems easier.
In order to meet the needs of modern distributed systems, you must ask yourself
how well a programming language will allow you to write applications that can expo-
nentially scale to serve millions of users connected on the web. It's no longer suffi-
cient to design a system that will scale to 2, 4, or 8 core processors. You need to ask if
your architecture will scale to 100, 1,000, or even 10,000 processors.
As we've discussed throughout this topic, most NoSQL solutions have been specifi-
cally designed to work on many computers. It's the hallmark of horizontal scalability
to keep all processors in your cluster working together and adapting to changes in the
cluster automatically. Adding these features after the fact is usually not possible. It
must be part of the initial design, in the lowest levels of your application stack. The
inability of SQL joins to scale out is an excellent example of how retrofits don't work.
Some software architects feel that to make the shift to true horizontal scale-out,
you need to make a paradigm shift at the language and runtime library level. This is
the shift from a traditional world of object and procedural programming to functional
programming. Today most NoSQL systems are embracing the concepts of functional
programming, even if they're using some traditional languages to implement the
lower-level algorithms. In this chapter, we'll look into the benefits of the functional
programming paradigm and show how it's a significant departure from the way things
are taught in most colleges and universities today.
10.1
What is functional programming?
To understand what functional programming is and how it's different from other pro-
gramming methods, let's look at how software paradigms are classified. A high-level
taxonomy of software paradigms is shown in figure 10.1.
We'll first look at how most popular languages today are based on managing pro-
gram state and memory values. We'll contrast this with functional programming,
which has a focus on data transformation. We'll also look at how functional program-
ming systems are closely matched with the requirements of distributed systems.
After reading this chapter, you'll be able to visualize functional programming as
isolated transformations of data flowing through a series of pipes. If you can keep this
model in mind, you'll understand how these transforms can be distributed over multi-
ple processors and promote horizontal scalability. You'll also see how side effects pre-
vent systems from achieving these goals.
Search WWH ::




Custom Search