ECP
One of the most powerful and unique features of Caché is the ability to efficiently distribute data and application logic among a number of server systems.
The underlying technology behind this feature is the Enterprise Cache Protocol (ECP): a distributed data caching architecture that manages the distribution of data and locks among a heterogeneous network of server systems.
Unlike other “multi-tier” architectures, ECP is primarily a configuration option. That is, you do not have to use special code or development techniques to create distributed database applications. This provides several important advantages over other technologies:
-
Applications can scale down as well as up. An application that is truly scalable can run on small systems as well as large using the same code base. With Caché you can deploy small scale systems using a single server and deploy the same application at large sites on multiple servers using ECP.
-
Applications are easier to develop. Instead of worrying about scalability and infrastructure, application developers can focus on core, customer-centric functionality.
-
Applications are reliable. ECP automatically recovers from most runtime problems (such as planned or unplanned system stoppages) with no user intervention.
This overview covers the following topics:
ECP Features
ECP provides the following features:
-
Automatic operation. Once configured, ECP automatically establishes and maintains connections between application servers and data servers.
-
Fail-safe operation. ECP automatically attempts to recover from any disconnections (planned or unplanned) among application server and data server systems. When it reestablishes a broken connection, ECP automatically restores the operating state of the system: it resumes all open transactions, restores locks, and recovers all database changes made by the application server.
If it cannot recover a connection in a reasonable time, ECP automatically rolls back any outstanding transactions involving the connection.
-
Heterogeneous networking. Caché systems in an ECP configuration can run on different hardware and operating system platforms. ECP automatically manages any required data format conversions.
-
A shared network buffer cache. ECP uses a portion of the Caché general database buffer pool to cache data retrieved across the network. This cache is shared among all Caché processes on an ECP application server system.
-
A robust transport layer based on TCP/IP. ECP uses the standard TCP/IP protocol for data transport, making it easy to configure and maintain.
-
Efficient use of network bandwidth. ECP is designed to take full advantage of the latest-generation, high-performance, networking infrastructures.
Besides providing a high degree of system availability, the automatic behavior of ECP makes a system easier to manage. For example, it is possible to take an ECP data server offline temporarily for a software upgrade and restore it without having to perform any operations on the ECP application server systems.
Uses for ECP
The primary reasons to use ECP are:
-
To provide greater scalability for applications, especially applications that are computationally-bound (that is, they are limited by the number of available CPU cycles and not by I/O operations).
-
As part of an application failover strategy for high availability systems. For more information see the “System Failover Strategies” and “ECP Failover” chapters of the Caché High Availability Guide.
For information on configuring a system for ECP, see the “Configuring Distributed Systems” chapter.
ECP Architecture
The architecture and operation of ECP is conceptually simple. ECP provides a way to efficiently share data, locks, and executable code among multiple Caché systems. Data and code are stored remotely, but are cached locally to provide efficient access with minimal network traffic.
For more information on application development and design using ECP, see the “Developing Distributed Applications” chapter.
Databases and Namespaces
To better understand how ECP works, it is first helpful to review how databases, namespaces, and caching work in Caché.
Caché stores data—persistent multidimensional arrays (globals) as well as executable code (routines)—in one or more physical structures called databases. A database consists of one or more physical files stored in the local operating system. A Caché system may (and usually does) have multiple databases.
Each Caché system maintains a database cache—a local, shared memory buffer used to cache data retrieved from the physical databases. This cache greatly reduces the amount of costly I/O operations required to access data and provides many of the performance benefits of Caché.
Caché applications access data by means of a namespace. A namespace provides a logical view of data (globals and routines) stored in one or more physical databases. A Caché system may (and usually does) have multiple namespaces.
Caché maps the data visible in a logical namespace to one or more physical databases. This mapping provides applications with a powerful mechanism for changing an application’s physical deployment (which disk drives are used, etc.) without changing application logic. This same mechanism, in conjunction with ECP, is what makes it possible to redeploy applications among multiple, networked systems with few or no application changes.
ECP Application Servers and Data Servers
An ECP configuration consists of a number of Caché systems that are visible to one another across a TCP/IP-based network. There are two roles a Caché system can play in an ECP configuration:
-
ECP Data Server — a Caché system that is providing data for one or more ECP application server systems.
-
ECP Application Server — a Caché system that is consuming data provided by one or more ECP data server systems.
A Caché system can simultaneously act as both an ECP data server and an ECP application server. However, one Caché instance cannot act as an ECP data server for the data it receives as an application server of another ECP data server.
In an ECP configuration, each ECP data server is responsible for the following:
-
Storing data in its local database.
-
Maintaining the coherency of the various ECP application server system database caches so that application servers do not see stale data.
-
Managing the distribution of locks across the network.
In an ECP configuration, each ECP application server is responsible for the following:
-
Establishing connections to a specific ECP data server whenever an application requests data that is stored on that server.
-
Monitoring the status of all connections to ECP data servers. If a connection is broken, or encounters any trouble, the ECP application server attempts to recover the connection.
-
Maintaining, in its cache, data retrieved across the network. This cache greatly reduces the number of costly network operations needed to access remote data.
ECP Connections and Recovery
ECP automatically establishes and maintains network connections between application server and data server systems. If a connection is broken, ECP automatically reestablishes the connection and restores the operating state of the system, if possible.
For more information on ECP connections, see the “Monitoring Distributed Applications” chapter.
For more information on ECP recovery, see the “Developing Distributed Applications” chapter.