Forge, the framework for building apps on Atlassian Cloud products like Jira and Confluence, provides multiple options for storing in-app data. Two primary methods are "Entity Properties" and "Forge Storage." Understanding the performance characteristics of each is crucial for developers looking to optimize their applications effectively. This article compares the performance of these two storage methods, explores when to use each one, and outlines how to conduct performance tests to evaluate their efficiency.
Watch the full video for an in-depth discussion https://youtu.be/Ge791dR98Pg
Entity Properties:
Entity Properties allow developers to store data directly on Atlassian entities, such as issues, pages, or users. This data is stored as key-value pairs associated with specific entities and is accessible via the REST API. This method is ideal for tightly coupling data with a specific Atlassian object and making it accessible across different parts of a plugin or even across multiple plugins.
Forge Storage:
Forge Storage offers a key-value storage system that operates independently of Atlassian entities. Designed for more general-purpose storage needs, Forge Storage provides flexibility and scalability. Data is accessed via the Forge Storage API, making it suitable for broader use cases.
Entity Properties:
Best for data that needs to be tightly coupled with a specific Atlassian entity, such as issue-specific metadata in Jira.
Ideal when data needs to be easily accessible through the Atlassian REST API, which aids integration with other plugins or scripts.
Recommended for relatively small datasets that do not require complex querying or relationships.
Forge Storage:
Ideal for general-purpose storage needs where data is not directly associated with an Atlassian entity.
Suitable for storing larger datasets or when complex querying capabilities are necessary.
Preferred when data needs to be stored globally or scoped to a tenant or environment, rather than being tied to specific entities.
To effectively compare the performance of Entity Properties and Forge Storage, we conducted a series of read and write operations, measuring the time taken to perform each request as well as the entire series of operations for both methods. Each operation was repeated 100 times to minimize fluctuations and obtain the most accurate average results.
Watch the video for a detailed explanation of the measurement techniques.
Let's start with Entity Properties:
The average time to set an issue entity property is around 201 ms (milliseconds) per request, with most requests ranging between 140 ms and 240 ms.
Get operations are faster, averaging around 151 ms per request.
How to Read the Charts: The x-axis represents the duration of the requests (in ms), while the y-axis shows the number of requests for each duration.
Now, let's look at Forge Storage:
The average time to set a storage entity is just 86 ms! Surprisingly, this is more than twice as fast as the equivalent “set” operation for Entity Properties.
The “get” operation is even more impressive, with an average time of only 67 ms, again more than twice as fast compared to getting an issue entity property.
Choosing between Entity Properties and Forge Storage depends on the specific needs of your application. Entity Properties are ideal for data that is closely tied to Atlassian entities and needs to be accessible through the REST API, especially when security is not a concern. In contrast, Forge Storage is better suited for more flexible and scalable storage needs, allowing for querying and aggregation.
Our performance tests show that Forge Storage is more than twice as fast as Entity Properties for both read and write operations. Even considering the limitations of the Forge platform, Forge Storage appears to be the preferable option for storing your app’s data.
The Atlassian team has done an excellent job optimizing the performance of Forge Storage. Even though there is still a long roadmap of improvements ahead, it is already proving to be fast and reliable for a variety of app needs. Well done, Atlassian!
Feel free to check out the repository containing the app I used for these performance tests and share your own results!
Andrei Pisklenov _Actonic_
Head of Development
Actonic
Germany
3 accepted answers
2 comments