diff --git a/README.md b/README.md index 6a24ef95d..fe633087c 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ you don't want to connect to the database while running the node. Furthermore, t __Sqlite__ is just like H2 a file based (embedded) database. Signum Node builds up the entire database out of the box and does not require any further set up. This makes Sqlite an interesting choice especially for less-technical users who just want to start and/or run a local (not publicly accessible) node. Choose this, if you want to run just a local node without public exposure. Furthermore, the resulting database file is easily shareable, such others can use a snapshot and sync from there. -Sqlite is still experimental, and considered as a substitute for H2. +Sqlite is considered as a replacement for H2. __MariaDB__ and __PostgreSQL__ on the other hand require an additional set-up. It is the better choice for publicly accessible nodes, as they are considered more stable, especially under higher load. @@ -93,15 +93,15 @@ The performance hit for MariaDB and PostgreSQL is related to the TCP/IP connecti Due to that model concurrent access is possible, i.e. one can run an additional service against the same database, which is not possible with H2, as the file gets locked. | | Stability | Speed | Setup | Backup | Concurrency | Purpose | -|------------|-----------|------|-------|--------|-------------|----------------------------------| -| H2 | - (1) | ⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐ | ❌ | Local Node | -| Sqlite | ⭐⭐ (2) | ⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐ | ✅ (3) | Local Node | -| MariaDB | ⭐⭐ | ⭐ | ⭐ | ⭐ | ✅ | Public Node, Additional Services | -| PostgreSQL | ⭐⭐ (2) | ⭐ | ⭐ | ⭐ | ✅ | Public Node, Additional Services | +|------------|----------|-------|-------|--------|-------------|----------------------------------| +| ~~H2~~ | - (1) | ⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐ | ❌ | Local Node [DEPRECATED] | +| Sqlite | ⭐⭐ | ⭐⭐* | ⭐⭐⭐ | ⭐⭐⭐ | ✅ (3) | Local Node | +| MariaDB | ⭐⭐ | ⭐ | ⭐ | ⭐ | ✅ | Public Node, Additional Services | +| PostgreSQL | ⭐⭐ (2) | ⭐ | ⭐ | ⭐ | ✅ | Public Node, Additional Services | -> (1) H2 - even with updated Version 2 - has proven to be unstable and causing database issues - mostly File I/O exceptions, and data inconsistencies. +> (1) DEPRECATED - H2 - even with updated Version 2 - has proven to be unstable and causing database issues - mostly File I/O exceptions, OOM and data inconsistencies. It will be removed with 3.9, so move to sqlite -> (2) PostgreSQL and Sqlite support is still experimental. So, stability needs to be proven over time, but in general Postgres itself is as least stable/reliable as MariaDB. +> (2) PostgreSQL support is still experimental. So, stability needs to be proven over time, but in general Postgres itself is as least stable/reliable as MariaDB. > (3) Sqlite supports concurrent reading. Writing is still limited to one writer at a time. ---- @@ -146,9 +146,9 @@ Note: the example ID above `8952122635653861124` is the [SNA](https://www.sna.si The cash-back is paid from block `1,029,000.` -**H2/MariaDB** +**SQLite/MariaDB** -By default Signum Node is using H2 (file based) as database. +By default Signum Node is using SQLite (file based) as database. If you like to use MariaDB you will need to adjust your `conf/node.properties`: ```properties diff --git a/src/brs/props/Props.java b/src/brs/props/Props.java index 4a4a28d0e..e67dff9b8 100644 --- a/src/brs/props/Props.java +++ b/src/brs/props/Props.java @@ -109,8 +109,7 @@ public class Props { // DB options public static final Prop DB_SKIP_CHECK = new Prop<>("DB.SkipCheck", false); - // TODO: change this when SQLITE turns out to be stable - public static final Prop DB_URL = new Prop<>("DB.Url", "jdbc:h2:file:./db/signum-v2;DB_CLOSE_ON_EXIT=FALSE"); + public static final Prop DB_URL = new Prop<>("DB.Url", "jdbc:sqlite:file:./db/signum.sqlite.db"); public static final Prop DB_USERNAME = new Prop<>("DB.Username", ""); public static final Prop DB_PASSWORD = new Prop<>("DB.Password", ""); public static final Prop DB_CONNECTIONS = new Prop<>("DB.Connections", 30); diff --git a/src/signum/net/MockNetwork.java b/src/signum/net/MockNetwork.java index 28ae7e1d9..c9c5892fe 100644 --- a/src/signum/net/MockNetwork.java +++ b/src/signum/net/MockNetwork.java @@ -29,10 +29,9 @@ public MockNetwork() { setProperty(Props.PK2_BLOCK_HEIGHT, "0"); setProperty(Props.SMART_ALIASES_HEIGHT, "0"); setProperty(Props.DEV_NEXT_FORK_BLOCK_HEIGHT, "0"); - + setProperty(Props.BRS_CHECKPOINT_HEIGHT, "-1"); setProperty(Props.BRS_CHECKPOINT_HASH, ""); - - setProperty(Props.DB_URL, "jdbc:h2:file:./db/signum-mock;DB_CLOSE_ON_EXIT=FALSE"); + setProperty(Props.DB_URL, "jdbc:sqlite:file:./db/signum.sqlite-mock.db"); } } diff --git a/src/signum/net/TestnetNetwork.java b/src/signum/net/TestnetNetwork.java index 849802bf2..26dc7ff49 100644 --- a/src/signum/net/TestnetNetwork.java +++ b/src/signum/net/TestnetNetwork.java @@ -64,8 +64,6 @@ public TestnetNetwork() { setProperty(Props.P2P_USE_PEERS_DB, "false"); setProperty(Props.P2P_SAVE_PEERS, "false"); - - setProperty(Props.DB_URL, "jdbc:h2:file:./db/signum-testnet-v2;DB_CLOSE_ON_EXIT=FALSE"); - + setProperty(Props.DB_URL, "jdbc:sqlite:file:./db/signum.sqlite-testnet.db"); } }