In Memory databases are a great solution for manipulating small/average volumes of data very quickly. This kind of database does not require any storage or disk I/O. They are particularly useful for temporary Stages or transforming structured data.
About H2 Database
H2 is a small and convenient SQL Database, for more information please read H2 Database official website.
The Designer and the Runtime both ship with H2. It can be used in several modes: embedded, server or memory.
The Runtime's default log database is an embedded H2 server. This H2 server can be used in your own Processes and Mappings, but you can also use H2 directly without using the H2 server.
There are a few things to keep in mind when working with an H2 in-memory database with Stambia :
- The Runtime and the Designer run into distinct Java Virtual Machines, so they don't share the same memory. A database created within the Designer's memory is not available for the Runtime, and the other way around.
- When executing Deliveries, they will share the same JVM or not, depending on how the launch mode:
- Execution with startcommand, ExecuteDelivery with "Memory Mode" checked, Schedules with "Memory Mode" checked : the execution takes place in the Runtime's JVM memory
- Execution with startdelivery, ExecuteDelivery with "Memory Mode" unchecked, Schedules with "Command Line" checked : the execution takes place in an autonomous Java process - in other words: in a separate Java Virtual Machine
- This distinction is important when working with an H2 "In Memory" Database, and when you want to share the data across multiple Delivery executions.
Creating a metadata for H2 Memory Database
Here is how to create such a metadata:
- Create an "H2 Database" Metadata
- Reverse only the PUBLIC schema
This Schema can then be used in mappings as a Stage, for example.