Skip to content

Comparison to other APIs

Lachlan edited this page Jun 13, 2023 · 24 revisions

This page is complete and is valid as of Treasury v2.0.0.

Notes

  • This page is written in our own opinion: it's completely valid that you may disagree with any of the thoughts we have.
  • If you have any comments, suggestions and/or criticisms for this page, please do post them on this issue.
  • Key: 🟢 = outstanding, 🟡 = satisfactory, 🟠 = limited, 🔴 = very limited. This is a score, not specifically an indicator on if a feature is included or not. For example, see Treasury's multi-world support comparison on the Economy API.

Economy API Comparison

Feature Treasury Vault Comment
Adoption 🔴 🟢 Treasury is brand new, so we have no idea how much it will be adopted. Currently very little adoption has taken place for this reason.
Documentation (Wiki & javadocs) 🟢* 🔴 *Treasury's documentation is currently work in progress. Treasury will have a far greater degree of documentation than Vault, so server owners and developers can understand how to use it. Vault's documentation is very limited.
Ease of Use 🟠 🟢 Treasury is more difficult to use as it strongly encourages developers to write concurrent code. We are consistently improving our documentation to reduce the friction caused by this feature.
Time since release 🔴 🟢 Treasury: Jan 2022; Vault: Oct 2011. This does not affect anything other than the resource's advantage in gaining adoption.
Stability 🟢 Treasury has only been recently released, so we are unable to compare stability of the API. It will only be determined with time. We are striving to keep a stable API by making great efforts to future-proof it, and we collect breaking changes (which are only made when strictly necessary) into major revision updates. Vault is very stable, due to its conservatism which in turn prevents improvements from being made to the platform.
Multi-platform 🟢 🔴 Vault is only operational on Bukkit, whilst Treasury's APIs are platform-independent.
Quality support 🟢 🔴 Vault has virtually no support. Treasury is supported on the Discord server and in other locations by active developers who are happy to help.
Concurrency 🟢 🔴 Treasury uses the popular CompletableFuture system from the Java standard library. Vault has no concurrency support whatsoever. Concurrency is important, as economy plugins frequently make database queries which can be sometimes quick, other times slow. When these queries are completed through Vault (synchronously - the only method it provides), it will freeze the server until the request is completed. Database queries are not instantaneous due to possible load at the time and connection speed if it is ran on a different server, especially if such is in a different location.
Willingness for change 🟢 🔴 If your proposed change to Vault breaks a plugin that hasn't been updated for 8 years, then forget it. Treasury will always strive to maintain a solid degree of legacy support, but we will not let it drag the project behind. The community must move forward.
Lack of Bloat 🟢 🟢 Treasury and Vault are strictly against having bloated APIs. However, Vault's plugin has compatibility code for plugins that haven't received updates in years. Treasury does not need any direct compatibility code, reducing bloat and improving the code quality.
Adoption of UUIDs 🟢 🟠 Vault still has deprecated APIs from years ago that developers still decide to use which have player names instead of UUIDs. Vault uses UUIDs through OfflinePlayer objects, but this can cause unnecessary server freezes whilst it needs to request data of a player from Mojang's servers. This issue is significantly amplified with 'baltop' operations, for example. Treasury uses pure UUIDs.
Non-player accounts 🟢 🟠 Vault's bank accounts require an owner, which is not suitable for all implementations. Treasury facilitates non-player accounts which are very similar to Vault's bank accounts, although do not require owners or members, and have a unique per-member bank permissions list, providing a greater degree of control for economy providers. Due to the limitations of Vault's bank account implementation, it does not seem to have gathered the usage it should have. We believe that the changes we've made make it suitable for more plugins to use.
Multi-currency 🟢 🔴 Vault does not offer any multi-currency support whatsoever.
Code quality 🟢 🟠 See for yourself.
Multi-world 🟠 🟡 Vault makes it optional to use their multi-world methods, which is essentially self-defeating its existence. Although Treasury does not have direct multi-world methods, it does make it easy for individual currencies to operate in a per-world manner, effectively achieving multi-world support without the burden of bloating the rest of the API with it. Currencies can be specified to operate primarily in certain worlds, which provides a multi-world functionality. Such economies are only used by a handful of servers relatively speaking as they are difficult to manage in the first place.
Well-designed EconomyResponse 🟢 🟠 Treasury has opted to build upon Vault's EconomyResponse by making it a generic class instead, significantly upgrading its capability. It also supplies better communication potential through the economy API by supplying a variety of reasons why a transaction was unsuccessful, other than a 'yes or no' result. Oh, and you don't have to use the 'success' or 'fail' as a 'yes' or 'no'.. for some reason Vault does that.. :)
Transaction history 🟢 🔴 Vault does not offer this functionality.
Transaction events 🟢 🔴 Vault does not offer this functionality.
Translatable & customisable messages 🟢 🔴 Vault does not offer this functionality.
Economy migration 🟢 🟡 We believe our migration system is more refined. For instance, it runs asynchronously. All Treasury data is transferred between providers.
Licensing 🟢 🟢 Treasury and Vault are both libre software with licenses that even permit API usage in proprietary software.
Data Type 🟢 🌕 Vault uses Doubles, whilst Treasury uses BigDecimals which are more precise.