2

Is it possible to persist data in Gigaspaces XAP 8 without resorting to an SQL database ? My application doesn't really have anything to do with SQL, and it would be a huge hassle to restructure everything to mirror the typical SQL design. But in the terrible XAP 8 documentation, only Hibernate/SQL is mentioned as possible persistence.

All I really want is for the data I put in my Space to not disappear when I restart XAP or my Processing Unit.

J. Stoever
  • 856
  • 12
  • 20

3 Answers3

5

GigaSpaces persistence is pretty generic and extendable. Persistence is provided using External Data Source. More information about External Data Source API is here, http://www.gigaspaces.com/wiki/display/XAP8/External+Data+Source+API

Above page also has a simple example. Example implementations for NoSQL Databases (MongoDB and Cassandra) are in GigaSpaces Best Practices Wiki, http://www.gigaspaces.com/wiki/display/SBP/NoSQL+External+DataStore

SKP
  • 135
  • 4
  • Unfortunately, those options also require various decorations or declarations and adaptations to turn my objects into something that fits into a database. – J. Stoever Mar 31 '12 at 20:42
  • Database decorations or declarations are dependent on the ORM framework you are using. If you are using Hibernate, annotations is one way to do it but you can also use a mapping files for this. None of the GigaSpaces annotations are mandatory. But if you wish to optimize the data access (add indexes or define your custom routing keys) you will need to decorate the class. GigaSpaces decorations can also be externalized using mapping files. Can you please clarify what declarations you are referring to? – SKP May 31 '12 at 17:59
1

Disclaimer:

In principle, since everything in your space should be serializable (if not, replication wouldn't work), you can simply write everything to a file. But this is a very bad idea, because you would have to serialize everything every time. A database handles the storage format for you, synchronization, it prevents corruption, it provides indexes...

Any non trivial persistence requirement will raise technical issues which would be too expensive to solve "in-house". Database are the right solution to use when persistence is required.


Good news: GigaSpaces provides you what you are looking for is Space Dump and Reload, based on the space copy API.

If you look at the end of the page, you see the following note:

Make sure the Space Dump utility has the /gigaspaces-xap-root/lib/platform/jdbc/h2.jar as part of its classpath.

In fact, it is backed by a database, H2SQLDB, which is probably populated through reflection

Edmondo
  • 19,559
  • 13
  • 62
  • 115
0

I suggest that you ask Gigaspaces customer support. This could be a feature that you have to pay for.


It's not, I looked at the features that are 'for sale'.

I suggest you ask anyway. Using one of the non-free editions may get you access to technical support, forums and/or better documentation.

Alternatively, you could "bite the bullet" and do the extra database-related work that you are trying to avoid doing.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216