# Archiving data on demand

**URL:** <https://forum.inductiveautomation.com/t/archiving-data-on-demand/33394>\
**Category:** Ignition\
**Created:** [March 25, 2020, 1:06pm UTC](https://forum.inductiveautomation.com/t/archiving-data-on-demand/33394 "2020-03-25T13:06:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![patricia.mendez](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@patricia.mendez](https://forum.inductiveautomation.com/u/patricia.mendez)\
**Post date:** [March 25, 2020, 1:06pm UTC](https://forum.inductiveautomation.com/t/archiving-data-on-demand/33394/1 "2020-03-25T13:06:06Z")

</div>

Dear supporters,

we’ve been asked to support a certain archiving scenario and I do not know if ignition does it on not. Let’s imagine we have tag whose value changes very often. Normally we do not want to archive all variations. Nevertheless, let’s imagine a certain occurrence and at that occurrence we want to dump the history fro 10s before to 30s after. Basically this implied having a circular buffer that delays the archiving process and allows you to decide a posteriori what to archive and what not. Or maybe Ignition foresees this use case in a different way, is this scenario supported by the tool?

Thanks so much in advance,  
Kind Regards,  
PAtricia

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 25, 2020, 1:19pm UTC](https://forum.inductiveautomation.com/t/archiving-data-on-demand/33394/2 "2020-03-25T13:19:16Z")

</div>

There is no built-in support for such operations. It is definitely scriptable, though. Python’s `deque` datatype, or the various java linked list classes are ideal for such tasks.

---

<div class="post-metadata">

**Author:** ![patricia.mendez](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@patricia.mendez](https://forum.inductiveautomation.com/u/patricia.mendez)\
**Post date:** [March 25, 2020, 1:23pm UTC](https://forum.inductiveautomation.com/t/archiving-data-on-demand/33394/3 "2020-03-25T13:23:30Z")

</div>

Thank you so much for the so prompt answer. Would you please send me some extra details/documentation if existing about the Python’s deque datatype you’ve mentioned?

Thanks again,  
Patricia

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 25, 2020, 1:34pm UTC](https://forum.inductiveautomation.com/t/archiving-data-on-demand/33394/4 "2020-03-25T13:34:48Z")

</div>

Sure:

[https://docs.python.org/2.7/library/collections.html](https://docs.python.org/2.7/library/collections.html)

---

<div class="post-metadata">

**Author:** ![patricia.mendez](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@patricia.mendez](https://forum.inductiveautomation.com/u/patricia.mendez)\
**Post date:** [March 25, 2020, 1:36pm UTC](https://forum.inductiveautomation.com/t/archiving-data-on-demand/33394/5 "2020-03-25T13:36:10Z")

</div>

Thank you so much, you’ve been very kind with me.  
Have a nice day,  
Patricia

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 25, 2020, 1:39pm UTC](https://forum.inductiveautomation.com/t/archiving-data-on-demand/33394/6 "2020-03-25T13:39:03Z")

</div>

If speed matters, I’d use the this java class:

[https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentLinkedDeque.html](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentLinkedDeque.html)

---

<div class="post-metadata">

**Author:** ![patricia.mendez](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@patricia.mendez](https://forum.inductiveautomation.com/u/patricia.mendez)\
**Post date:** [March 25, 2020, 1:44pm UTC](https://forum.inductiveautomation.com/t/archiving-data-on-demand/33394/7 "2020-03-25T13:44:31Z")

</div>

Great!, I am more a python person though 🙂 I feel more confortable using python  
Thanks!!

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 25, 2020, 2:12pm UTC](https://forum.inductiveautomation.com/t/archiving-data-on-demand/33394/8 "2020-03-25T14:12:02Z")

</div>

Well, Ignition doesn’t use CPython, it uses Jython. One of the key advantages of jython is that it can import and use Java classes and object as if part of Python. Since java objects are native to the JVM (and JIT to native machine code), they tend to be dramatically faster than the corresponding python library types. A few python types, like `socket`, are pathologically slow. Others interact poorly with Ignition’s underpinnings, like `datetime`.

I highly recommend learning to use java classes within jython (no need to actually learn java).

---

<div class="post-metadata">

**Author:** ![patricia.mendez](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@patricia.mendez](https://forum.inductiveautomation.com/u/patricia.mendez)\
**Post date:** [March 25, 2020, 2:26pm UTC](https://forum.inductiveautomation.com/t/archiving-data-on-demand/33394/9 "2020-03-25T14:26:34Z")

</div>

Ok, I take your point. It seems to be a matter of importing java classes without needing to have a particular knowledge of java programming, which is fair enough.  
Thank you for so many good advice  
Patricia
