TIBCO ActiveSpaces Concepts
An ActiveSpaces distributed application system is a set of ActiveSpaces programs that cooperate to fulfill a mission (either using the administrative CLI tool or the ActiveSpaces API calls). Tuples are distributed, rather than “partitioned” across seeders (members that are configured to contribute memory and processing resources to a space).
- Introduction to TIBCO ActiveSpaces Applications
ActiveSpaces applications are programs that use ActiveSpaces software to work collaboratively over a shared data grid. The data grid comprises one or more tuple spaces. - Basic ActiveSpaces Terms
- Metaspace
A metaspace is a logical group of spaces—a cluster of hosts and processes that share the same metaspace name and set of discovery transport attributes. - Space
Spaces are the main feature offered by ActiveSpaces. Together with metaspaces, spaces provide a distributed data grid. - Tuples and Fields
ActiveSpaces spaces store data in tuples. - Indexes
ActiveSpaces automatically builds a distributed, in-memory index of the tuples in the space when a space is created or loaded. Because indexes are stored in memory, queries locate matching records more quickly because the queries do not have to iterate through every record. - Basic Operations on Tuples
You can perform basic operations on tuples such as, Put, Get, Take, Lock, and Update. - The Put Operation Storing Data into a Space
Your application can store data into a space by using the space’s put method and passing it a tuple as its argument. - Batch Versus Blocking Operations
By default, spaces are distributed, which means that the servicing of requests and storage of entries for the space is implemented in a distributed manner by all of the space's seeders. - Space Data Retrieval Methods
You can retrieve (or consume) data from a space in three ways: Get Method, Callback Query Method, and Space Browser Method. The method you use to retreive data from a space depends on the application logic of your code. - The Take Operation Consuming or Removing Data from a Space
You can remove tuples from a space by using the space’s take method and passing a tuple containing the appropriate key fields for that space. - Space Members and Member Roles
Applications that need access to a space join the space and become space members. - Space Definition
You must define a space in the metaspace before it can be joined by applications and agents. The space is created when a member of the metaspace joins it and becomes the first member of the space. Conversely, the space is destroyed when the last member leaves it (and there are no more members of the space). - Distribution
A space may be either distributed or non-distributed. - Replication
To provide fault-tolerance and prevent loss of tuples if one of the seeders in a space suddenly goes down, you can specify that space data is replicated—backed up one or more seeders. - Host-Aware Replication
To enable host-aware replication, you can group seeders to help prevent the loss of replicated data. With host-aware replication, the data from the seeders in one group is replicated on seeders that reside in other groups. - Space Storage Options and Persistence
- Expiration Time to Live and Tuple Locking
- Concurrent Data Update in a Space
When multiple processes concurrently get and update tuples in a space, two processes might try to update the same tuple at the same time. In that case, it is often necessary to serialize updates. - Data Lock in a Space
ActiveSpaces allows users to lock records and keys in the space. The granularity of the locking in ActiveSpaces is a key, meaning that any possible key that could be used in the space can be locked, regardless of whether a tuple is actually stored in the space. - Results
Most batch space operations return results (or collections of results). Results objects contain information about the result of the operation and are always returned by those operations regardless of the operation being a success or a failure. - Browsers
ActiveSpaces provides another method of interacting with spaces—space browsers. - Listeners
ActiveSpaces can proactively notify applications of changes to the tuples stored in a space. Users can invoke the metaspace or space’s listen method to obtain a listener on spaces for receiving event notifications. - Filters
ActiveSpaces supports the application of filters to both listeners and browsers, as well as the ability to evaluate a tuple against a filter. Filters allow your application to further refine the set of tuples it wants to work with using a space browser or event listener. - Remote Invocation of Code over a Space
ActiveSpaces allows space members to remotely invoke code on other members of the space. This feature allows the code to be co-located with the data for optimal performance. - Transactions
ActiveSpaces Enterprise Edition allows you to atomically perform sets of space operations using transactions. - Deployment
ActiveSpaces is a peer-to-peer distributed in-memory tuple space. This means that the tuples are stored in the memory of a cluster of machines working together to offer the storage of tuples. There is no central server used for the coordination of operations, but rather any number of peers working together to offer a common service. - Networking Considerations
Applications can connect to the metaspace either as full peers to the other peers of the metaspace, at which point they will need to be able to establish and receive TCP connections from all the other full peers of the metaspace (regardless of their role in individual spaces), or as 'remote clients' that connect to the metaspace through establishing a single TCP connection to a proxying ActiveSpaces agent process (itself a fully connected peers). - Special Considerations for Joining a Space or Metaspace
- The as-agent Utility as a Seeder
The amount of data that can be stored in a space depends on the number of seeding members of that space. It can be necessary to add seeders to a space to scale it up. - Remote Clients
If you have purchased a license for the Remote Client Edition of TIBCO ActiveSpaces, then you can implement ActiveSpaces on remote clients. - ActiveSpaces Routing
The ActiveSpaces routing feature is implemented by means of a callback function, similar to the callback function used with shared-all persistence. Using routing, your application forwards updates to another site, and receives a status message in return. The operation is blocked until the status is returned. - Performance Monitoring
The ActiveSpaces utility programs, as-admin and as-agent, support performance monitoring. - The ASCommon Object
The ASCommon class provides a set of static methods for managing metaspaces. ASCommon can be used to connect to a metaspace, retrieve a list of currently connected metaspaces, and set a global log level. - The tibasMetaspace_Connect Method
Typically, one of the first things an ActiveSpaces process does is connect to a metaspace. - The close Method
When your application terminates or no longer needs to use the spaces in a particular metaspace, it should disconnect from it using the metaspace’s close method. - The getSelfMember method
When connecting to a metaspace, each application is automatically assigned (or provides) a unique member name within that metaspace. Your application can determine this name by invoking the metaspace’s getSelfMember method, which returns a Member object. - The getUserSpaceNames Method
You can retrieve the list of names of the user spaces that are currently defined in the metaspace by using the metaspace’s getUserSpaceNames method, which in Java returns a String[] and in C returns a StringList object (tibasStringList *). - File Logging
Using a set of methods in the Java API set, you can control file logging, and also set up rolling log files. - The defineSpace Method
You must first define space in the metaspace before it can be joined by applications and agents. - The getSpaceDef Method
You can get the space definition for a space that has been previously defined in the metaspace by using the Metaspace object’s getSpaceDef method, which takes a space name as a parameters and returns either a copy of that space’s SpaceDef object or throws an exception if no space of that name is currently defined in the metaspace. - The dropSpace Method
You can delete a space’s space definition from a metaspace by invoking the dropSpace method of the Metaspace object. This call will only succeed if there are no members to that space at the time this method is invoked. It is also possible to drop a space using the Admin tool. - Distribution Policy Methods
You can set or get a space’s distribution policy by using the SpaceDef object’s setDistributionPolicy and getDistributionPolicy respectively. The value of the distribution policy argument can be either DISTRIBUTED (which is the default value) or NON_DISTRIBUTED. - Define Capacity
You can define a capacity for the space to control the amount of memory used by the seeders for storing tuples in the space. The capacity is expressed in number of tuples per seeder and defaults to -1, which means an infinite number of tuples per seeder. - Host-Aware Replication
With host-aware replication, you group seeders based upon their member names. - LockTTL Methods
The entry TTL can be set or returned using the SpaceDef objects’s setTTL and getTTL methods, respectively. - Methods to Define Fields
ActiveSpaces provides the FieldDef API to handle field definitions. Using the API you can create, field definitions and perform basic operations to Get and Put field definitions. - The getSpace Method
After a space has been defined in the metaspace, applications can join the space— and as-agents started in the network automatically join the space if the space is distributed. - The close Method
Your application can leave a space by invoking the space object's close() method (Java API), by calling the tibasSpace_Free() function (C API), or by stopping the listeners or browsers that may have joined the space automatically when created. - Persistence
You can specify the persistence type and persistence policy when you define a space. - Tuple
The simplest way to look at a tuple is as a map of fields, that is, an object in which you can put, get, and remove fields. A tuple can also be seen as a self-contained, self-describing set of fields. - The getName and getSpaceDef Methods
You can get the name and the space definition of the space represented by the Space object by invoking the getName and getSpaceDef methods respectively. - Context Tuples
ActiveSpaces supports a special tuple called a context tuple. A context tuple is used to dynamically pass user-defined information between your ActiveSpaces processes. A context tuple does not need to have any particular set of fields. You are free to decide the information you want to pass back and forth between your processes. - The Read and Write in a Space
The Get and Take operations are used to read from a space. The Put operations is used to write to a space. - Lock and Unlock Methods
You can make a key in a space read-only by locking it. When a key is locked, only the lock owner has the ability to modify the data that is stored with that key. Locking is enforced regardless of the presence or not of a record for the key being locked. - Use of Transactions
ActiveSpaces supports transactions to keep data consistent, even in cases of system failure. - Batch Operations
Because in most installations, ActiveSpaces is deployed with seeders on many machines on the same network, some of the operations might need a complete network round trip to complete. Therefore, large improvements in throughput can be achieved by parallelizing operations using the batch versions of the space operations whenever possible. - Listeners
Listeners are used to monitor events that represent changes to the tuples stored in a space. - SpaceEvent Objects
SpaceEvent objects are either passed as the argument to methods of a class implementing the SpaceListener interface or returned by an EventBrowser’s next method. - Space Browser Methods
Although you can use a listener to query the data in a space, in practice, you will almost always use space browsers: a browser is used to iterate through the contents of a space. - ASEventBrowser
An event browser is the iterative version of a listener’s next() method and returns the next event (the same kind of object you would get in a listener) in the space's event stream. Just like any other browser or listener, it can take a filter and has the same time and distribution scopes. - Performance Monitoring
To enable the performance monitor from your application, call the function or method provided with the API set that you are using. - Remote Space Invocation
With TIBCO ActiveSpaces 2.0.0, the Java API and the .NET API allow applications to remotely invoke code execution over the space to other members. - Space as a Cache
- Working with Remote Clients
If you have purchased the TIBCO ActiveSpaces Remote Client in addition to the Enterprise Edition, then you can implement applications that run on remote clients and which communicate with a space running on the core ActiveSpaces cluster.
Copyright © Cloud Software Group, Inc. All rights reserved.