How to Deliver

Radical Architectural Change
SIDNEY SHEK • ARCHITECT •
ATLASSIAN • @SIDNEYSHEK
…without the customer noticing!
ROBIN FERNANDES • TEAM LEAD •
ATLASSIAN • @REWBS
Source: BMW S1000 RR. Dinner for RR. www.youtube.com/watch?v=-cM9S2AzU28
22TB attachments moved
65m objects
Zero major incidents
Done during business hours
60,000 +Virtualised Linux containers
120,000 +Monolithic application
instances
A solid platform for all
BlobStore
Why
microservices?
Scale and Agility
Getting the
Architecture Right
Replicas everywhere
Logging and
metrics
Seamless
deployment
Resource
management
Monitoring and
alerts
+
service

descriptor
.json }{service artifact
{
...
scaling: {
min: 5
}
loadBalancer: {
timeout: 600
}
...
}
Heavy lifting by Atlassian PaaS
Pure Functional
Architecture
BlobStore
server
S3 bucket
Uploading to BlobStore
Stored at b10b
(SHA-1 of content)
PUT att-1
BlobStore
server
S3 bucket
Uploading to BlobStore
Stored at b10b
(SHA-1 of content)
PUT att-1
ETAG b10b
BlobStore
server
S3 bucket
Uploading to BlobStore
Dynamo table
Stored at b10b
(SHA-1 of content)
PUT att-1
ETAG b10b
BlobStore
server
S3 bucket
Logical Key Sequence Operation
att-1 1 Insert b10b
Uploading to BlobStore
Dynamo table
Stored at b10b
(SHA-1 of content)
BlobStore
server
S3 bucket
Logical Key Sequence Operation
att-1 1 Insert b10b
Deleting from BlobStore
DELETE att-1
ETAG b10b
Dynamo table
Stored at b10b
(SHA-1 of content)
BlobStore
server
S3 bucket
Logical Key Sequence Operation
att-1 1 Insert b10b
att-1 2 Delete
Deleting from BlobStore
DELETE att-1
ETAG b10b
204 “OK”
Dynamo table
Stored at b10b
(SHA-1 of content)
BlobStore
server
S3 bucket
Logical Key Sequence Operation
att-1 1 Insert b10b
att-1 2 Delete
Deleting from BlobStore
DELETE att-1
ETAG b10b
204 “OK”
Dynamo table
Stored at b10b
(SHA-1 of content)
BlobStore
server
S3 bucket
Logical Key Sequence Operation
att-1 1 Insert b10b
att-1 2 Delete
att-1 3 Insert b10b
Restoring in BlobStore
DELETE att-1
ETAG b10b
Building the
Software Right
Strongly typed
functional
progamming
Use proper types.
For everything.
Proper types for
property-based
testing
‘Example’ based unit test = 1 manually written test case
Property-based test = 100s auto-generated examples
Advanced types to
simplify testing of
non-blocking code
Production code runs asynchronously
new S3Storage[Future](bucketName)
Test code runs synchronously
new S3Storage[Id](bucketName)
Confidence
through continuous
deployment
Merge to master
in Stash
Merge to master
in Stash
Merge to master
in Stash
Automated staged
deployments
to prod < 2 hours
Smooth
Roll-Out
&
Data Migration
© Mathieu Jarry
Estimate Up Front
Shadow First
Gradually Increase the Criticality of the New Service
Disk BlobStore
1
Disk BlobStore
2
Disk BlobStore
3
JIRA JIRA JIRA
Roll out to Cohorts
Rolling Out Progressively
Data Centre 1
AWS
Customer instance in
OpenVZ container
(approx. 1500 per rack)
Rack 1
…
Rack N
…
…
…
Data Centre 2
Rack 1
…
Rack N
…
…
…
Data Centre 3
Rack 1
…
Rack N
…
…
…
Step 1: A Manageable Number of Instances
Data Centre 1
AWS
Rack 1
…
Rack N
…
…
…
Data Centre 2
Rack 1
…
Rack N
…
…
…
Data Centre 3
Rack 1
…
Rack N
…
…
…
Step 2: Full Racks
Data Centre 1
AWS
Rack 1
…
Rack N
…
…
…
Data Centre 2
Rack 1
…
Rack N
…
…
…
Data Centre 3
Rack 1
…
Rack N
…
…
…… …
Step 3: All Instances
Data Centre 1
AWS
Rack 1
…
Rack N…
Data Centre 2
Rack 1 Rack N…
Data Centre 3
Rack 1 Rack N…
… … … … … … … …
Repeat For Next Mode!
Data Centre 1
AWS
Rack 1
…
Rack N…
Data Centre 2
Rack 1 Rack N…
Data Centre 3
Rack 1 Rack N…
… … … … … … … …
Repeat For Next Mode!
Data Centre 1
AWS
Rack 1
…
Rack N…
Data Centre 2
Rack 1 Rack N…
Data Centre 3
Rack 1 Rack N…
… … … … … … … …… …
Repeat For Next Mode!
Data Centre 1
AWS
Rack 1
…
Rack N…
Data Centre 2
Rack 1 Rack N…
Data Centre 3
Rack 1 Rack N…
… …… ……………… …
Know Your
Monitoring
Have an “Off”
Switch
Make your data migration
idempotent.
Organisation
&
Ownership
Micros (PaaS)
DevOps, Atlassian Style
One team owns the change, end-to-end.
JIRA
JIRA Attachment Manager
BlobStore Plugin
BlobStore
Client
BlobStore
Server
BlobStore Migration Plugin
Support
Scripts
Monitoring
Tooling
Roll-out
Tooling
Roll-out
Process
Consumer Service
Operational
Tooling
Processes
Monitoring
Process
Incident
Response
Owned by the
BlobStore team
Data
Deletion
1. A microservices architecture requires investment
in infrastructure.
2. Safety needs to be built into the architecture
and software from the onset
3. Plan for gradual roll-outs & data migrations
4. End-to-end ownership means architectural
flexlibility and fewer / less severe incidents
5. Don’t underestimate the integration points –
technical and people.
Key Takeaways
aws-scala lib:
http://bitbucket.org/atlassian/aws-scala
event sourcing lib:
http://bitbucket.org/atlassianlabs/eventsrc
How to deliver radical architectural change
without the customer noticing
Submit your feedback:
go.atlassian.com/acarchitectural

AtlasCamp 2015: How to deliver radical architectural change without the customer noticing