Chapter 10. NoSQL and functional programming

 

This chapter covers

  • Functional programming basics
  • Examples of functional programming
  • Moving from imperative to functional programming

The world is concurrent. Things in the world don’t share data. Things communicate with messages. Things fail.

Joe Armstrong, cocreator of Erlang

In this chapter, we’ll look at functional programming, the benefits of using a functional programming language, and how functional programming forces you to think differently when creating and writing systems.

The transition to functional programming requires a paradigm shift away from software designed to control state and toward software that has a focus on independent data transformation. Most popular programming languages used today, such as C, C++, Java, Ruby, and Python, were written with the needs of a single node as a target platform in mind. Although the compilers and libraries for these languages do support multiple threads on multicore CPUs, 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 languages that focus on isolated data transformations to make working with distributed systems easier.

10.1. What is functional programming?

10.2. Case study: using NetKernel to optimize web page content assembly

10.3. Examples of functional programming languages

10.4. Making the transition from imperative to functional programming

10.5. Case study: building NoSQL systems with Erlang

10.6. Apply your knowledge

10.7. Summary

10.8. Further reading