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 Picture
Users
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 Caring
Caches
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 Guide

developer.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

AtlasCamp 2014: Preparing Your Plugin for JIRA Data Center

  • 1.
    June 3-5, 2014| Berlin, Germany
  • 2.
    Chris Fuller, SeniorDeveloper, Atlassian Data Center for Developers
  • 3.
    • About DataCenter • Hazards for Plugins • Marketplace • Resources ! Data Center for Developers
  • 4.
    • Clustering • Scaleand Performance • High Availability • Hardware Maintenance • Unexpected outages Data Center: The Reasons
  • 5.
    Data Center: ThePicture Users WAN Index Database JIRA
  • 6.
    Data Center: ThePicture WAN Users . . . Replicated Indexes Multiple JIRA Nodes Database Shared Home Load Balancer
  • 7.
    • What youdon’t know… • Long-lived caches • Scheduled tasks • Locking Plugins: Danger Zone!
  • 8.
    Sharing is Caring Oddsand Ends Locks Scheduled Tasks Caches
  • 9.
    • Expensive Information •I/O costs • CPU costs • Caching is not free • Memory costs • Consistency risks Caches: The Problem ?!
  • 10.
    • Local orclustered • Replication control • By invalidation • By copy • Lazy loading pattern • Statistical reporting Caches: Atlassian Cache 2.0
  • 11.
    • Rolling yourown • HTTP Session as a cache • Unbounded caches • Custom key classes • Enumerating the keys Caches: Asking for Trouble ?!
  • 12.
    • Don’t keepstate! • Atlassian Cache API • Lazy load pattern • Set bounds • Maximum size? • Timeout (30 minutes) • Use simple keys Caches: Best practices
  • 13.
    Sharing is Caring Oddsand Ends Locks Caches Scheduled Tasks
  • 14.
    • Per-node maintenance •Atlassian Scheduler API • SAL PluginScheduler • Backward compatibility • Confluence ! Scheduler: Local 1:00 2:00 3:00 4:00
  • 15.
    • Runs onany one node • Atlassian Scheduler API • Quartz (Deprecated) • Compatibility library Scheduler: Clustered 1:00 2:00 3:00 4:00
  • 16.
    • Atlassian SchedulerAPI • 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
  • 17.
    Sharing is Caring Oddsand Ends Caches Scheduled Tasks Locks
  • 18.
    • synchronized • java.util.concurrent •atlassian-util-concurrent Locks: Local
  • 19.
    • Atlassian Beehive •Cluster-wide • Cheap in single node Locks: Clustered
  • 20.
    • Problems • Expensivein a cluster • Not read/write ! ! • Alternatives • Lock-free SQL ordering • Optimistic locking • Tolerating inconsistency • Transactions Locks: The Details
  • 21.
  • 22.
    • Application HomeSplit • Local home • Shared home No Place Like Shared Home • Application Home Split • Local home • Shared home • Application Home Split • Local home • Shared home
  • 23.
    Data Center Ready! <plugin-info> <description>${project.description}</description> <version>${project.version}</version> <vendorname="${project.organization.name}" url="${project.organization.url}" /> <param name="atlassian-data-center-compatible">true</param> </plugin-info>
  • 24.
    • JIRA PluginGuide
 developer.atlassian.com/display/JIRADEV/Plugin+Guide+to+JIRA+High+Availability+and+Clustering • Confluence Plugin Guide
 developer.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
  • 25.
    June 3-5, 2014| Berlin, Germany