RocksDB as a Data Source
MemoryXtend for fast recovery (from 17.1.2 version)
Using memoryXtend persistence can speed up recovery time significantly compared to recovery from standard relational databases.
In some use cases, the in-memory space can’t use memoryXtened as extreme write/update/take performance is required, and a direct persistence approach can’t be used. In these cases, it is recommended to use two spaces - one as the main in-memory space and a secondary space for persistence.
This can be achieved by one of the following ways:
-
Streaming change operations to both spaces, as shown in the diagram below:
-
Replicating all changes from the main space to the secondary space in an async manner, as shown in the diagram below:
This is the recovery flow for both options:
Define the recovery flow in the space PU
Use the following code to define the recovery flow in the space PU This is the unit of packaging and deployment in the GigaSpaces Data Grid, and is essentially the main GigaSpaces service. The Processing Unit (PU) itself is typically deployed onto the Service Grid. When a Processing Unit is deployed, a Processing Unit instance is the actual runtime entity.:
<?xml version="1.0" encoding="utf-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:os-core="http://www.openspaces.org/schema/core"
xmlns:blob-store="http://www.openspaces.org/schema/rocksdb-blob-store"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.openspaces.org/schema/core http://www.openspaces.org/schema/core/openspaces-core.xsd
http://www.openspaces.org/schema/rocksdb-blob-store http://www.openspaces.org/schema/rocksdb-blob-store/openspaces-rocksdb-blobstore.xsd">
<!-- Enables the usage of @GigaSpaceContext annotation based injection. -->
<os-core:giga-space-context />
<!-- Enables Spring Annotation configuration -->
<context:annotation-config />
<os-core:annotation-support />
<!--regular space -->
<bean id="rocksDBDataSource" class="com.gigaspaces.blobstore.rocksdb.RocksDBDataSource">
<property name="spaceName" value="mxspace"/>
<property name="basePath" value="gs-home/work/memoryxtend/rocksdb"/>
</bean>
<os-core:embedded-space id="space" space-name="rcspace" space-data-source="rocksDBDataSource" >
</os-core:embedded-space>
<!-- OpenSpaces simplified space API built on top of IJSpace/JavaSpace. -->
<os-core:giga-space id="gigaSpace" space="space"/>
</beans>