SlideShare a Scribd company logo
Breaking a Monolith
In-Place Refactoring with Service-Oriented Architecture
at a Life-Sciences Startup
Ryan M Harrison, PhD
Head of Engineering
BioBright
The Lab
2
3
Image Metadata
Objective
Excitation
Emission
Label
Reagents
Protocols
Exp Metadata Analysis MetadataRaw Image
Collect all the things
4
Business proposition
in development
DarwinSync DarwinSpeech DarwinTerminal
5
6
Courtesy of https://www.weave.works
7
MicroservicesMonoliths
8
Shiny things!
API Gateway Lambda
9
10
Self-reflection
- B2B / Enterprise
- Unconstrained problem
- Scaling needs?
11
Self-reflection
- B2B / Enterprise ⇒ On prem?
- Unconstrained problem ⇒ Rapid iteration
- Scaling needs? ⇒ Slow / predictable
12
Code: 2016
exports.lastActions = function(req, res) { // data query for lastActions, ember data model
console.log("req: ", req.query);
var user = req.query.user; // get user
var x1 = Math.floor(req.query.x[0]); // get start of time range
var x2 = Math.floor(req.query.x[1]); // end of time range
coknexions[req.lab]('data') // query from data table on users lab
.whereIn('source', user) // query source
.whereBetween("x",[x1, x2]) // query range
.orderBy('x', 'desc') // oldest to newest
.then(function(r){ // results in r
res.json({lastActions:r}); // send in form expected by ember
});
};
13
Self-reflection
exports.lastActions = function(req, res) {
console.log("req: ", req.query);
var user = req.query.user;
var x1 = Math.floor(req.query.x[0]);
var x2 = Math.floor(req.query.x[1]);
coknexions[req.lab]('data')
.whereIn('source', user)
.whereBetween("x",[x1, x2])
.orderBy('x', 'desc')
.then(function(r){
res.json({lastActions:r});
});
};
No documentation
14
Self-reflection
exports.lastActions = function(req, res) {
console.log("req: ", req.query);
var user = req.query.user;
var x1 = Math.floor(req.query.x[0]);
var x2 = Math.floor(req.query.x[1]);
coknexions[req.lab]('data')
.whereIn('source', user)
.whereBetween("x",[x1, x2])
.orderBy('x', 'desc')
.then(function(r){
res.json({lastActions:r});
});
};
Minimal logging
15
Self-reflection
exports.lastActions = function(req, res) {
console.log("req: ", req.query);
var user = req.query.user;
var x1 = Math.floor(req.query.x[0]);
var x2 = Math.floor(req.query.x[1]);
coknexions[req.lab]('data')
.whereIn('source', user)
.whereBetween("x",[x1, x2])
.orderBy('x', 'desc')
.then(function(r){
res.json({lastActions:r});
});
};
No input specification
(or validation)
No output specification
16
Self-reflection
exports.lastActions = function(req, res) {
console.log("req: ", req.query);
var user = req.query.user;
var x1 = Math.floor(req.query.x[0]);
var x2 = Math.floor(req.query.x[1]);
coknexions[req.lab]('data')
.whereIn('source', user)
.whereBetween("x",[x1, x2])
.orderBy('x', 'desc')
.then(function(r){
res.json({lastActions:r});
});
};
Inadequate interface to DB layer
17
Problem
- B2B / Enterprise ⇒ On prem?
- Unconstrained problem ⇒ Rapid iteration
- Scaling needs? ⇒ Slow / predictable
- Engineering maturity ⇒
- Code quality ⇒
18
Must be
this tall
to ride
(the hype)
2016
Not tall enough
19
Must be
this tall
to ride
(the hype)
?
2016
Not tall enough
20
Not tall enough
Dev portal
Monitoring
On demand infra scaling
Continuous Integration
Continuous Deployment
21
Glide paths
API spec → API docs → Dev portal
Logging → Monitoring
Infra → On demand infra scaling
Testing → Continuous Integration
Deployment → Continuous Deployment
22
3 B’s
Build it
Borrow it
Buy it
23
Image Metadata
Objective
Excitation
Emission
Label
Reagents
Protocols
Exp Metadata Analysis MetadataRaw Image
Collect all the things
24
API
25
Raw Image Analysis MetadataExperiment MetadataImage Metadata
API APIAPIAPI
API
26
API (Borrow)
/protocols/notes:
x-swagger-router-controller: protocols
post:
operationId: post_note
security:
- JWT: [write:protocols]
parameters:
...
schema:
$ref: '#/definitions/Note'
responses:
"200":
$ref: "#/responses/ProtocolsResponse"
27
API (Borrow)
function post_note (req, res) {
let content = note.value.data.attributes['content']
let context = note.value.data.attributes['context']
Note
.forge({content: content, context: context})
.save()
.then(function (response) {
let note = mapper.map(response, 'note')
return res.json(note)
})
.catch(function (err) {
...
})
}
28
API (Borrow)
- Logically separated services
- DB ORM, serialisation (JSONAPI)
- Specification and validation (middleware)
- Interactive API docs (tooling)
29
Logging (Borrow)
{
"name": "...",
"hostname": "...",
"pid": 7,
"level": 30,
"req": {
"requestID": "ab9add8f-ceb5-4015-b0d1-2b0b52772add",
"method": "POST",
"url": "/api/protocols",
"remoteAddress": "...",
"remotePort": ...,
"protocol": "https",
"xhr": false,
"headers": {
"host": "..."
}
},
"responseTime": 40.46, // milliseconds
"msg": "API request log",
"time": "...",
"v": 0.5.3
}
Bunyan
30
Logging (Borrow + Buy)
CloudWatch Logs
{
"name": "...",
"hostname": "...",
"pid": 7,
"level": 30,
"req": {
"requestID": "ab9add8f-ceb5-4015-b0d1-2b0b52772add",
"method": "POST",
"url": "/api/protocols",
"remoteAddress": "...",
"remotePort": ...,
"protocol": "https",
"xhr": false,
"headers": {
"host": "..."
}
},
"responseTime": 40.46, // milliseconds
"msg": "API request log",
"time": "...",
"v": 0.5.3
}
Bunyan
31
Infra (Borrow)
module "cloud" {
source = "./BioBrightCloud"
public-key-path = "...”
}
module "database" {
source = "./BioBrightDB"
vpc-id = "${module.cloud.vpc-id}"
database-release = "v0.1.4"
}
module "ember" {
source = "./EmberBioBright"
ember-release = "v0.3.1"
ember-environment = "${terraform.env}"
}
>> terraform apply
32
Testing (Borrow)
parameters:
device_id_path:
name: device_id
in: path
description: ID of device fetch
required: true
type: string
x-example: "..."
33
Testing (Borrow)
hooks.before('protocols > /api/protocols/notes > POST > 200 > application/json; charset=utf-8', function
(transaction) {
let testData = Math.random().toString(36).substring(2)
transaction.request.body = `{"data":{"attributes":{"content":"${testData}","context":{}}}}`
})
hooks.beforeEach(function (transaction) {
transaction.request.headers['Authorization'] = `Bearer ${jwt.token}`
})
34
Deployment (Buy)
Elastic Beanstalk Elastic Beanstalk
+
ECS
35
Summary
API spec Borrow OpenAPI
Logging Borrow + Buy Bunyan +
CloudWatch
Infra Borrow Terraform
Testing Borrow Dredd
Deployment Buy ElasticBeanStalk or
ECS
36
1:1 Service : Swagger controller
1:1 Service : CloudWatch log group
1:1 Service : Terraform Module
1:1 Service : Repo (or Container)
Service Oriented Architecture
37
MicroservicesMonoliths
Service
Oriented
Architecture
38
LinkedIn: https://www.linkedin.com/in/harrisonrm/
Medium: https://medium.com/@rmharrison
Stack Overflow: https://stackoverflow.com/story/rmharrison

More Related Content

Similar to Breaking a monolith: In-place refactoring with service-oriented architecture at a life-sciences startup (20)

PDF
I Love APIs Europe 2015: Developer Sessions
Apigee | Google Cloud
 
PDF
Microservices Architecture
Izzet Mustafaiev
 
PDF
Geoscience and Microservices
Matthew Gerring
 
PDF
µServices Architecture @ EPAM WOW 2015
Izzet Mustafaiev
 
PPTX
Leveraging Envoy Proxy and GraphQL to Lower the Risk of Monolith to Microserv...
Christian Posta
 
PPTX
Enterprise Microservices
Krishnanand Sivaraj
 
PPTX
Breaking down a monolith
GeekNightHyderabad
 
PDF
Microservices on a budget meetup
Matthew Reynolds
 
PPTX
Decomposing the Monolith using modern-day .NET and a touch of microservices
Dennis Doomen
 
PPTX
Delivering Developer Tools at Scale
Oracle Developers
 
PPTX
apidays LIVE Helsinki - The quick growth forced change from legacy to decoupl...
apidays
 
PDF
apidays LIVE Australia 2020 - Strangling the monolith with a reactive GraphQL...
apidays
 
PDF
JS Fest 2018. Никита Галкин. Микросервисная архитектура с переиспользуемыми к...
JSFestUA
 
PDF
"The working architecture of NodeJs applications" Viktor Turskyi
Julia Cherniak
 
PPTX
Architectures, Frameworks and Infrastructure
harendra_pathak
 
PDF
PiterPy 2016: Parallelization, Aggregation and Validation of API in Python
Max Klymyshyn
 
PPTX
apidays Paris 2024 - Hexagonal Modules, Adil Baaj, Theodo
apidays
 
PDF
APIdays Singapore 2019 - Blowing Up the Monolith: Adopting a Modern API Strat...
apidays
 
PDF
Divide and Conquer – Microservices with Node.js
Sebastian Springer
 
PDF
The working architecture of NodeJS applications, Виктор Турский
Sigma Software
 
I Love APIs Europe 2015: Developer Sessions
Apigee | Google Cloud
 
Microservices Architecture
Izzet Mustafaiev
 
Geoscience and Microservices
Matthew Gerring
 
µServices Architecture @ EPAM WOW 2015
Izzet Mustafaiev
 
Leveraging Envoy Proxy and GraphQL to Lower the Risk of Monolith to Microserv...
Christian Posta
 
Enterprise Microservices
Krishnanand Sivaraj
 
Breaking down a monolith
GeekNightHyderabad
 
Microservices on a budget meetup
Matthew Reynolds
 
Decomposing the Monolith using modern-day .NET and a touch of microservices
Dennis Doomen
 
Delivering Developer Tools at Scale
Oracle Developers
 
apidays LIVE Helsinki - The quick growth forced change from legacy to decoupl...
apidays
 
apidays LIVE Australia 2020 - Strangling the monolith with a reactive GraphQL...
apidays
 
JS Fest 2018. Никита Галкин. Микросервисная архитектура с переиспользуемыми к...
JSFestUA
 
"The working architecture of NodeJs applications" Viktor Turskyi
Julia Cherniak
 
Architectures, Frameworks and Infrastructure
harendra_pathak
 
PiterPy 2016: Parallelization, Aggregation and Validation of API in Python
Max Klymyshyn
 
apidays Paris 2024 - Hexagonal Modules, Adil Baaj, Theodo
apidays
 
APIdays Singapore 2019 - Blowing Up the Monolith: Adopting a Modern API Strat...
apidays
 
Divide and Conquer – Microservices with Node.js
Sebastian Springer
 
The working architecture of NodeJS applications, Виктор Турский
Sigma Software
 

More from Ryan M Harrison (8)

PPTX
2020-11-13 Anatomy of a FHIR Implementation Guide
Ryan M Harrison
 
PDF
2021 12-03 TOGAF for Developers
Ryan M Harrison
 
PDF
Positioning yourself for success in technical careers
Ryan M Harrison
 
PPTX
2019-01-24 Sequelize ORM (Object Relational Mapper): models, migrations, oh my
Ryan M Harrison
 
PPTX
2019-08-23 API contract testing with Dredd
Ryan M Harrison
 
PDF
End-To-End Asymmetric Encryption of Biomedical Data In-Transit and At-Rest
Ryan M Harrison
 
PDF
Nest v. Flat with EmberData
Ryan M Harrison
 
PDF
DEF CON 24: Reverse engineering biomedical equipment for fun and open science
Ryan M Harrison
 
2020-11-13 Anatomy of a FHIR Implementation Guide
Ryan M Harrison
 
2021 12-03 TOGAF for Developers
Ryan M Harrison
 
Positioning yourself for success in technical careers
Ryan M Harrison
 
2019-01-24 Sequelize ORM (Object Relational Mapper): models, migrations, oh my
Ryan M Harrison
 
2019-08-23 API contract testing with Dredd
Ryan M Harrison
 
End-To-End Asymmetric Encryption of Biomedical Data In-Transit and At-Rest
Ryan M Harrison
 
Nest v. Flat with EmberData
Ryan M Harrison
 
DEF CON 24: Reverse engineering biomedical equipment for fun and open science
Ryan M Harrison
 
Ad

Recently uploaded (20)

PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PPTX
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
Ad

Breaking a monolith: In-place refactoring with service-oriented architecture at a life-sciences startup