Databases Reference
In-Depth Information
In summary, if you associate URI s with the output of referentially transparent func-
tions and services, frameworks such as NetKernel can bring the following benefits:
Faster web page response time for users
Reduced wasteful re-execution of the same functions on the same data
More efficient use of front-end cache RAM
Decreased demand on your database, network, and disk resources
Consistent development architecture
Note that the concepts used in this front-end case study can also be applied to other
topics in back-end analytics. Any time you see functions being re-executed on the
same datasets, there are opportunities for optimization using these techniques.
In our next section, we'll look at functional programming languages and see how
their properties allow you to address specific types of performance and scalability
issues.
10.3
Examples of functional programming languages
Now that you have a feeling for how functional programs work and how they're differ-
ent from imperative programs, let's look at some real-world examples of functional
programming languages. The LISP programming language is considered the pioneer
of functional programming. LISP was designed around the concept of no-side-effect
functions that work on lists. The concept of recursion over lists was frequently used.
The Clojure language is a modern LISP dialect that has many benefits of functional
programming with a focus on the development of multithreaded systems.
Developers who work with content management and single-source publishing sys-
tems may use transformation languages such as XSLT and XQuery (introduced in
chapter 5). It's no surprise that document stores also benefit from functional lan-
guages that leverage recursive processing. Document hierarchies that contain other
hierarchies are ideal candidates for recursive transformation. Document structures
can be easily traversed and transformed using recursive functions. The XQuery lan-
guage is a perfect fit with document stores because it supports recursion and func-
tional programming, and yet uses database indexes for fast retrieval of elements.
There has been strong interest by developers working on high-availability systems
in a functional programming language called Erlang. Erlang has become one of the
most popular functional languages for writing NoSQL databases. Erlang was originally
developed by Ericsson, the Swedish telecommunications firm, to support distributed,
highly available phone switches. Erlang supports features that allow the runtime
libraries to be upgraded without service interruption. NoSQL databases that focus on
high availability such as CouchDB, Couchbase, Riak, and Amazon's SimpleDB services
are all written in Erlang.
The Mathematica language and the R language for doing statistical analysis also use
functional programming constructs. These ideas allow them to be extended to run on
a large numbers of processors. Even SQL , which doesn't allow for mutable values, has
Search WWH ::




Custom Search