atlascamp 2014: preparing your plugin for jira data center
DESCRIPTION
JIRA and Confluence are introducing new product editions with support for high availability and clustering. Depending on your add-on, supporting enterprise-grade deployments of JIRA and Confluence could require updates to your plugin. Get a sneak preview of the application architecture for HA and clustering, and learn how you can ensure your plugin is ready to run in these mission critical installations.TRANSCRIPT
June 3-5, 2014 | Berlin, Germany
Chris Fuller, Senior Developer, Atlassian
Data Center for Developers
• About Data Center
• Hazards for Plugins
• Marketplace
• Resources
!
Data Center for Developers
• Clustering
• Scale and Performance
• High Availability
• Hardware Maintenance
• Unexpected outages
Data Center: The Reasons
Data Center: The PictureUsers
WAN
Index
Database
JIRA
Data Center: The Picture
WAN
Users
. . .Replicated Indexes
Multiple JIRA Nodes
Database Shared Home
Load Balancer
• What you don’t know…
• Long-lived caches
• Scheduled tasks
• Locking
Plugins: Danger Zone!
Sharing is Caring
Odds and Ends
Locks
Scheduled Tasks
Caches
• Expensive Information
• I/O costs
• CPU costs
• Caching is not free
• Memory costs
• Consistency risks
Caches: The Problem
?!
• Local or clustered
• Replication control
• By invalidation
• By copy
• Lazy loading pattern
• Statistical reporting
Caches: Atlassian Cache 2.0
• Rolling your own
• HTTP Session as a cache
• Unbounded caches
• Custom key classes
• Enumerating the keys
Caches: Asking for Trouble
?!
• Don’t keep state!
• Atlassian Cache API
• Lazy load pattern
• Set bounds
• Maximum size?
• Timeout (30 minutes)
• Use simple keys
Caches: Best practices
Sharing is Caring
Odds and Ends
Locks
Caches
Scheduled Tasks
• Per-node maintenance
• Atlassian Scheduler API
• SAL PluginScheduler
• Backward compatibility
• Confluence
!
Scheduler: Local
1:00
2:00
3:00
4:00
• Runs on any one node
• Atlassian Scheduler API
• Quartz (Deprecated)
• Compatibility library
Scheduler: Clustered
1:00
2:00
3:00
4:00
• Atlassian Scheduler API
• Clustered run-immediately job
• Could run twice
• Specify initial run time
• Unscheduling on disable
• Unschedules for whole cluster
• Unregister job runner instead
Scheduler: Dos and Don’ts
Sharing is Caring
Odds and Ends
Caches
Scheduled Tasks
Locks
• synchronized
• java.util.concurrent
• atlassian-util-concurrent
Locks: Local
• Atlassian Beehive
• Cluster-wide
• Cheap in single node
Locks: Clustered
• Problems
• Expensive in a cluster
• Not read/write
!
!
• Alternatives
• Lock-free SQL ordering
• Optimistic locking
• Tolerating inconsistency
• Transactions
Locks: The Details
Sharing is CaringCaches
Locks
Scheduled Tasks
Odds and Ends
• Application Home Split
• Local home
• Shared home
No Place Like Shared Home
• Application Home Split
• Local home
• Shared home
• Application Home Split
• Local home
• Shared home
Data Center Ready!
<plugin-info>
<description>${project.description}</description>
<version>${project.version}</version>
<vendor name="${project.organization.name}" url="${project.organization.url}" />
<param name="atlassian-data-center-compatible">true</param>
</plugin-info>
• JIRA Plugin Guide developer.atlassian.com/display/JIRADEV/Plugin+Guide+to+JIRA+High+Availability+and+Clustering
• Confluence Plugin Guidedeveloper.atlassian.com/pages/viewpage.action?pageId=2031761
• docs.atlassian.com/atlassian-cache-api
• docs.atlassian.com/atlassian-scheduler-api
• docs.atlassian.com/beehive-api
• bitbucket.org/cfuller
!
Resources
June 3-5, 2014 | Berlin, Germany