Multiple persistence services possible in 2.1?

I have seen some postings that it is not possible to use multiple persistence services at the same time, for different items, yet the paper UI allows me to define multiple services, and under Configuration->System->Persistence it says “persistence service to use if no other is specified”, which makes me wonder if there may be a way (in 2.1?) to specify a different service for specific Items?

I would like to use rr4dj for most things since I don’t mind the data eventually falling off, but I have a few Items that I would like to keep their values indefinitely in my sqllite database.
Thanks.

I’m using rrd4j for some and MAPDB for all items successfully.

rrd4j + influxdb. Including at the same time for some elements.

You can use different persistence services at the same time. There is no restriction to do so. Sure you have to configure multiple *.persist files. There are perstence services that might not support all item types, e.g. rrd4j will not store Strings nor Switches but only Numbers and Values.

However, if using jdbc persistence, I’m not aware of any way to use different databases at the same time. But of course you could use additional persistence services like mysql persistence service to fill more than one sql database at the same time :slight_smile:

Thanks I got it working. I created the jdbc.persistence file to go with my rrd4j.persist, and used service=“jdbc” in the sitemap to get Charts from sqlite and it works great. Will experiment with influx in the future, but I just happen to have a sqlitedb for other projects so wanted to test that first. Thanks again.

Do you have a link to any of these postings? They are incorrect and if like to go add the correct information as a response.

I’ll go back and look. It wasn’t the official docs just some random posts I came across.

There is a section on Persistence Extensions in the documentation:

“Note that you can specify that a different persistence service be used with a particular extension. Do this by appending a String as an optional additional parameter at the end of the extension (e.g. “rrd4j” or “sense”)”

And there is the persistence extension,

“.persist - Persists the current State of the item”

So it seems that you could have the following as a persistence rule:

Lights.persist.rrd4j

that would persist Lights in a rrd4j database, but I have not personally tested this. Perhaps someone else can comment.

Actually it would be

Lights.persist("rrd4j")

That section in the docs you quoted from needs to change. It is misleading.

Dude! That is totally what I was hoping would happen - clarification of the documentation. I am working on that part of the manual with Thom now and will fix it! (FWIW, was the Dude at the beginning a little over the top? After all, I am from the USA :wink:

Caution - Off Topic!
@rlkoshak, one other quick question while I have you… If one wants to “escape” angle brackets so that they appear, what is the trick please? When I put something between a pair of angle brackets the brackets and the stuff in-between them disappears.

Code fences. If you are doing it inline use a single backtick:

Some text yadda yadda yadda `<inline code>` yadda yadda yadda

For a block of code or logs you can use the </> icon above the text entry, the icons on the right (hover over them to see what code fences they insert), or type in the code fences youself:

```csv
items and things go here
```

```php
rules, sitemap goes here
```

```javascript
javascript code goes here
```

```
other code, logs go here
```