SlideShare a Scribd company logo
New Life inside 
Monolithic Application 
This presentation will be useful to those 
who would like to get acquainted with lifetime 
history 
of successful monolithic Java application 
By Taras Matyashovsky 
Taras Matyashovsky, Software Engineer/Team & Tech Lead, CSM, @tmatyashovsky
Introduction
About me 
• Software engineer/TL 
• Worked for outsource companies, 
product companies and tried myself in 
startups/freelancing 
• 8+ years production Java experience 
• Fan of Agile methodologies, CSM 
• Founder of Morning@Lohika 
tech talks in Lviv 
Introduction
This Presentation 
• shows architectural and technical 
evolution of one Java web startup that 
is beyond daily coding routine 
• contains a lot of 
• simplifications 
• Captain Obvious 
• internet memes 
Introduction
Notice 
• business domain is not important 
• this presentation is not intended for 
monolithic vs. micro services 
architectures comparison 
Introduction
Agenda 
• You’ve decided to build a startup 
• You’ve built a startup 
• Early issues 
• Solutions 
• Still not enough 
• New solution 
• Proof of concept 
• New life inside monolith 
• Next goals 
• Groupon way 
• Conclusions 
• Instead of epilogue 
Introduction
You’ve Decided to 
Build a Startup
You’ve Decided 
to Build a Startup 
about 5 years ago 
You’ve decided to build a startup
Product Overview 
• business model – B2B 
•main product flow: 
• import data from customer 
• process data, e.g. validate, filter, pre-calculate 
• show different analytics to end users 
You’ve built a startup
Technology Stack 
4-5 years ago you’ve probably have 
chosen: 
• Java 6.x 
• JDBC/Hibernate 
• Spring with emphasis on Spring MVC 
• HTML/CSS/JSP 
• JS/jQuery 
• MySQL 5.x 
You’ve built a startup
Tools 
4-5 years ago you’ve probably have 
chosen: 
• Maven 2.x 
• Jetty 6.x 
• Jenkins 
• Subversion 
• JIRA 
• Confluence 
You’ve built a startup
You’ve Built a Startup 
You’ve built a startup
Architecture 
Not thinking about: 
•scalability 
•performance 
• customization 
• l10n, i18n 
You’ve built a startup
SaaS Maturity 
Model (Level 2) 
You’ve built a startup
Architecture 
You’ve built a startup
Architecture 
You’ve built a startup
Architecture 
You’ve built a startup
You’ve Built a Startup 
Single tenant 
monolithic stateful 
application 
with no thought on cost of 
future scalability, customization, 
l10n/i18n and performance 
You’ve built a startup
You’ve Built a Startup 
with reasonable trade-offs and 
compromises 
You’ve built a startup
You’ve Built a Startup 
And it became a successful product 
You’ve built a startup
Early Issues
Internal Quality 
•time to market vs. internal 
quality 
•business logic becomes more 
and more complicated 
Early Issues
A Lot of Customers 
•each customer wants specific 
features 
•seamless integration 
•l10n, i18n 
Early Issues
Early Issues 
Early Issues
Issues => Challenges 
Early Issues
Solutions
Internal Quality 
“A well-written program is a program where the cost of 
implementing is constant thought-out the project lifetime” 
Solutions
Internal Quality 
•formal code review process 
via Atlassian Crucible 
•integration with 
CheckStyle/PMD with strict 
set of rules 
Solutions
Internal Quality 
•unit/integration tests 
•functional tests bases on 
htmlunit/jwebunit written and 
maintained by developers 
Solutions
Internal Quality 
•automation tests framework 
based on 
Ruby/Selenium/Cucumber 
written and maintained by QA 
engineers 
•performance tests using 
NewRelic 
Solutions
A Lot of Customers 
Still continue 
with maturity level 2 
and tackle customization, i18n, 
l10n problems separately 
Solutions
Maturity Level 2 
Solutions
Internal Customization 
•is implemented via hierarchy 
of application.properties files 
Solutions
Ruby Scripts 
• start application per default “demo” 
customer 
• start application in debug mode 
• start application per specific customer 
using local/remote db 
• load fixtures data to main/test local 
database 
• start application in web tests mode 
• run specific web test 
Solutions
Specific Features 
•created additional Spring 
contexts per customer 
•introduced unique Spring 
beans per customer and 
injected them via aliases 
Solutions
External 
Customization 
• each customer had specific static 
assets, e.g. styles, images, js, etc. 
• Sass framework was used to 
reasonably generate CSS files per 
customer 
Solutions
Storage 
•one database schema per all 
customers 
•patches per customer during 
deployment 
Solutions
Code Organization 
•maintained one repository for 
default “demo” customer 
•created separated 
repositories per each 
customer 
Solutions
Customer Repo 
Contains: 
• java files 
• Spring contexts 
• database patches 
• static assets, e.g. styles, images, tags, 
etc. 
Web app for each customer 
is unpackaged and customized 
at deploy time 
Solutions
So 
•code and product complexity 
is controlled in certain bounds 
•internal product quality is high 
Solutions
So 
•build, testing, deployment, 
customization, localization 
processes are automated 
Solutions
Summary 
Successful product that 
overgrew startup stage and 
is delivered to more than 
90 customers all over the 
globe 
Solutions
Still not Enough
Business Issues 
•customization is limited 
• as business domain is unique 
product is hard to be sold to more 
than 1 customer in region/country 
Still not Enough
DevOps Issues 
•high maintenance cost 
•not effective utilization of 
resources 
Still not Enough
Engineering Issues 
•it is impossible to develop/test 
new features without the 
entire stack running 
•high cost for even tiny change 
Still not Enough
Unfortunately 
Current application is 
expensive 
to maintain, customize and 
configure 
Still not Enough
New Solution
New Solution 
Redesign existing web solution 
as a multi-tenant widget-based 
application 
with easier customization and 
configuration support 
New Solution
•lower maintenance cost 
•easier customization via 
configuration and static 
assets that can be re-deployed 
without releasing 
software 
Goals 
New Solution
Goals 
•modular architecture with 
well-defined contracts 
•split of front-end and back-end 
with possibility to easily 
provide public API 
New Solution
Vision
Vision 
Z 1.2.4 
Widget YX 21.0.01 WWiiddggeett YZ 12..20..30 
New Solution 
Widget Container X 1.0.0 
1 
Container 2 Container 3
Skeleton 
•will describe header, footer, 
as well as main page loader 
•unique per application 
New Solution
Page Layout 
•will be defined via templates 
that describe containers in 
which appropriate widgets will 
be loaded 
New Solution
Widget 
•separated web application 
representing some major 
feature of application 
New Solution
Widget 
• is a consolidation of html, css, js plus all 
necessary images and localized 
message properties 
• is going to be stored on static assets 
server 
• should be built according to unified 
web application framework 
New Solution
Targeting API 
•will provide data essential to 
build page layout based on a 
template with widgets to be 
loaded in particular containers 
New Solution
Sequence Diagram 
HTML Skeleton 
Common (branded) CSS 
Common Code: 
• targeting call 
• page layout 
New Solution 
Static 
Content Server 
CDN 
Layout / 
Targeting 
API 
Widget 
Specific 
API(s) 
Widget HTML 
Widget CSS 
Widget Code 
1 
3 
2 
4
Looks Great 
New Solution
Nuance 
New Solution
Nuance 
That should be done in parallel 
with the existing application 
development 
New Solution
Nuance 
One proof-of-concept widget 
with corresponding APIs 
should be implemented 
to prove future architecture 
New Solution
Proof of Concept
Widgets 
Technology Stack 
• Angular 
• Node.js 
• Bower 
• Grunt 
• Karma (ex. Testacular), Mocha, 
Jasmine, PhantomJS 
• Additional custom libraries for mocking 
and localization were also built 
Proof of Concept
API 
Technology Stack 
Created essential APIs inside 
existing web application using: 
• Spring Restful services 
• Spring rest template/JSON assert for 
testing 
Proof of Concept
Targeting API 
• provides targeting page layout for 
particular customer and logged-in 
user 
• provides information if user is 
currently logged in 
• provides authentication endpoint 
URL 
• provides static assets endpoint URL 
Proof of Concept
Authentication API 
•is used by page loader to 
force user authentication 
Proof of Concept
Static Assets API 
• handles all GET requests and 
serves up static assets either from 
file system or from Amazon S3 
• combines expiration and validation 
caching strategies, supports 
gzipping 
Proof of Concept
Current Sequence 
Diagram 
Monolithic Web App 
Page Loader 
Common (branded) CSS 
Common Code: 
• dependencies 
• client for targeting API 
• client for authentication API 
Proof of Concept 
Static 
Content 
Server 
CD 
N 
Static Assets 
API 
Layout / 
Targeting 
API 
Widget 
Specific 
API(s) 
Widget HTML 
Widget CSS 
Client for Widget API 
Authentication API 
Redesigned Page 1 
2 
3 
4 
5 
6
New Life inside 
Monolith
Temporary 
Architecture 
New Life inside Monolith
New Approach 
•one widget in production 
using described APIs that live 
inside existing monolith 
•web framework for front-end 
developers to build more 
widgets 
New Life inside Monolith
So 
Selected 
architecture, technology stack 
and tools were proven 
New Life inside Monolith
Next Goals
Next Goals 
•improve web framework, e.g. 
repository management, end 
to end tests, etc. 
•rebuild other pages using 
widgets approach when 
needed 
Next Goals
Next Goals 
•dismantle the monolith using 
SOA-like services 
•create mobile clients 
connected to redesigned 
unified API 
Next Goals
Possible Architecture 
Next Goals
Groupon Way
•migrated frontend from Ruby 
to Node.js infrastructure 
•the old monolithic frontend 
was split up into ~20 separate 
web apps 
Groupon Way 
“Dismantling the 
Monoliths”
•ability to deploy changes to 
applications independently 
•ability to make site-wide 
feature and design changes 
much more quickly 
Groupon Way 
“Dismantling the 
Monoliths”
Groupon Architecture 
Groupon Way
Conclusions
Conclusions 
•monolithic applications can be 
successful 
Conclusions
Conclusions 
•you should have a good 
reasons for dismantling as 
well as for choosing micro 
services architecture 
Conclusions
Conclusions 
•gradual dismantling the 
monolithic application is 
doable 
Conclusions
Conclusions 
Conclusions
Instead of Epilogue
A Good Architecture 
Enables Agility 
By Simon Brown, @simonbrown, http://www.simonbrown.je/
Just Think 
If you can’t build a structured 
monolith what makes you think 
micro services is the answer? 
Don’t blindly copy what everybody 
else seems to be doing 
By Simon Brown, @simonbrown, http://www.simonbrown.je/
Monolith vs. 
Micro Services 
By Aviran Mordo, https://twitter.com/aviranm/status/531925339518148609/photo/1
Monolith vs. 
Micro Services 
Instead of Epilogue
Thanks! 
Questions? 
New Life inside Monolithic Application by Taras 
Matyashovsky 
Design by
References 
• http://martinfowler.com/articles/microservices.html 
• http://www.infoq.com/news/2014/08/microservices-monoliths 
• http://www.infoq.com/news/2014/08/microservices_ballmud 
• http://www.infoq.com/presentations/development-deployment-collaboration-etsy 
• https://twitter.com/aviranm/status/531925339518148609/photo/1 
• https://thecloudworld.wordpress.com/tag/maturity-model/ 
• http://highscalability.com/blog/2014/7/28/the-great-microservices-vs-monolithic- 
apps-twitter-melee.html 
• http://www.codingthearchitecture.com/presentations/devday2014-software-software- 
architecture-vs-code 
• http://www.simonbrown.je/ 
• https://engineering.groupon.com/2013/misc/i-tier-dismantling-the-monoliths/ 
References

More Related Content

PPTX
From cache to in-memory data grid. Introduction to Hazelcast.
PDF
Distributed applications using Hazelcast
KEY
Infinspan: In-memory data grid meets NoSQL
PDF
Big Data, Simple and Fast: Addressing the Shortcomings of Hadoop
PDF
Hazelcast 3.6 Roadmap Preview
PDF
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle
PDF
Time to Make the Move to In-Memory Data Grids
PDF
EDB Postgres with Containers
 
From cache to in-memory data grid. Introduction to Hazelcast.
Distributed applications using Hazelcast
Infinspan: In-memory data grid meets NoSQL
Big Data, Simple and Fast: Addressing the Shortcomings of Hadoop
Hazelcast 3.6 Roadmap Preview
Ashnik EnterpriseDB PostgreSQL - A real alternative to Oracle
Time to Make the Move to In-Memory Data Grids
EDB Postgres with Containers
 

What's hot (20)

PDF
Building Apps with Distributed In-Memory Computing Using Apache Geode
PPTX
Visualizing Kafka Security
PDF
Speed Up Your Existing Relational Databases with Hazelcast and Speedment
PPTX
From Insights to Value - Building a Modern Logical Data Lake to Drive User Ad...
PPTX
Hive2.0 sql speed-scale--hadoop-summit-dublin-apr-2016
PDF
Active/Active Database Solutions with Log Based Replication in xDB 6.0
 
PDF
Hazelcast for Terracotta Users
PPTX
Trusted advisory on technology comparison --exadata, hana, db2
PPTX
Storage and-compute-hdfs-map reduce
PDF
Web session replication with Hazelcast
PDF
Slides for the Apache Geode Hands-on Meetup and Hackathon Announcement
PDF
HBase Status Report - Hadoop Summit Europe 2014
PDF
Cloudera Impala: A modern SQL Query Engine for Hadoop
PPTX
PDF
Introduction to Apache Geode (Cork, Ireland)
PPTX
Running secured Spark job in Kubernetes compute cluster and integrating with ...
PPT
Tool Academy: Web Archiving
PDF
Efficient Spark Analytics on Encrypted Data with Gidon Gershinsky
PDF
Overview of EnterpriseDB Postgres Plus Advanced Server 9.4 and Postgres Enter...
 
PDF
C* Summit 2013: Searching for a Needle in a Big Data Haystack by Jason Ruther...
Building Apps with Distributed In-Memory Computing Using Apache Geode
Visualizing Kafka Security
Speed Up Your Existing Relational Databases with Hazelcast and Speedment
From Insights to Value - Building a Modern Logical Data Lake to Drive User Ad...
Hive2.0 sql speed-scale--hadoop-summit-dublin-apr-2016
Active/Active Database Solutions with Log Based Replication in xDB 6.0
 
Hazelcast for Terracotta Users
Trusted advisory on technology comparison --exadata, hana, db2
Storage and-compute-hdfs-map reduce
Web session replication with Hazelcast
Slides for the Apache Geode Hands-on Meetup and Hackathon Announcement
HBase Status Report - Hadoop Summit Europe 2014
Cloudera Impala: A modern SQL Query Engine for Hadoop
Introduction to Apache Geode (Cork, Ireland)
Running secured Spark job in Kubernetes compute cluster and integrating with ...
Tool Academy: Web Archiving
Efficient Spark Analytics on Encrypted Data with Gidon Gershinsky
Overview of EnterpriseDB Postgres Plus Advanced Server 9.4 and Postgres Enter...
 
C* Summit 2013: Searching for a Needle in a Big Data Haystack by Jason Ruther...
Ad

Viewers also liked (20)

PPTX
Morning at Lohika 1st anniversary
PPTX
Modas Urbanas De MéXico
PDF
Boletas tucuman
PDF
Historia fedo
PDF
Guida ospitalità
PPTX
How can we trust the historical reliability of new testament with fonts
PDF
Leadbolt Advertiser Deck - 2015
PPT
Bilanz 2012
PDF
Lindorff - den forsømte kommunikation
PDF
Phone Systems Brisbane - 16 questions a 27 year telco veteran would ask befor...
PDF
Vertetesia
DOCX
Pueblos fantasmas de Argentina
PDF
Cristina Rey Entrevista Revista Ejecutivos
PDF
Le Studio Graphique presentation
PDF
Einführung der e funktion 2
PDF
іспан.мова редько 8 рік
PPT
20120628. carlos malpica faustor. presentación en el xi forum nacional de con...
PDF
Basta de bullying
Morning at Lohika 1st anniversary
Modas Urbanas De MéXico
Boletas tucuman
Historia fedo
Guida ospitalità
How can we trust the historical reliability of new testament with fonts
Leadbolt Advertiser Deck - 2015
Bilanz 2012
Lindorff - den forsømte kommunikation
Phone Systems Brisbane - 16 questions a 27 year telco veteran would ask befor...
Vertetesia
Pueblos fantasmas de Argentina
Cristina Rey Entrevista Revista Ejecutivos
Le Studio Graphique presentation
Einführung der e funktion 2
іспан.мова редько 8 рік
20120628. carlos malpica faustor. presentación en el xi forum nacional de con...
Basta de bullying
Ad

Similar to New life inside monolithic application (20)

PDF
Sitecore development approach evolution – destination helix
PDF
Big ideas in small packages - How microservices helped us to scale our vision
PPTX
Decision CAMP 2014 - Erik Marutian - Using rules-based gui framework to power...
PDF
Out With the Old, in With the Open-source: Brainshark's Complete CMS Migration
PDF
CV - Abhijit
PDF
Next Generation Architecture Showcase July 2019
PDF
Lifecycle Management with SharePoint Apps and Solutions
PDF
Agile Secure Cloud Application Development Management
PDF
CarTrawler's Feature Team Architecture and Development Process Showcase by Lu...
PDF
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
PPT
Road to agile: federal government case study
PPTX
Continuous Integration
PDF
Introduction to the web engineering Process.pdf
PDF
Cincom Smalltalk Roadmap 2010
PDF
Cincom Smalltalk News
PDF
Tech Talk on Cloud Computing
PPTX
ALM with TFS: From the Drawing Board to the Cloud
PPTX
#spsclt18 vincent biret #spfx #devops
PDF
Using BladeRunnerJS to Build Front-End Apps that Scale - Fluent 2014
PPTX
Vs11 overview
Sitecore development approach evolution – destination helix
Big ideas in small packages - How microservices helped us to scale our vision
Decision CAMP 2014 - Erik Marutian - Using rules-based gui framework to power...
Out With the Old, in With the Open-source: Brainshark's Complete CMS Migration
CV - Abhijit
Next Generation Architecture Showcase July 2019
Lifecycle Management with SharePoint Apps and Solutions
Agile Secure Cloud Application Development Management
CarTrawler's Feature Team Architecture and Development Process Showcase by Lu...
The API Lifecycle Series: Exploring Design-First and Code-First Approaches to...
Road to agile: federal government case study
Continuous Integration
Introduction to the web engineering Process.pdf
Cincom Smalltalk Roadmap 2010
Cincom Smalltalk News
Tech Talk on Cloud Computing
ALM with TFS: From the Drawing Board to the Cloud
#spsclt18 vincent biret #spfx #devops
Using BladeRunnerJS to Build Front-End Apps that Scale - Fluent 2014
Vs11 overview

More from Taras Matyashovsky (9)

PPTX
Morning 3 anniversary
PPTX
Distinguish Pop from Heavy Metal using Apache Spark MLlib
PPTX
Introduction to ML with Apache Spark MLlib
PPTX
Morning at Lohika 2nd anniversary
PPTX
Confession of an Engineer
PPTX
Influence. The Psychology of Persuasion (in IT)
PPTX
JEEConf 2015 - Introduction to real-time big data with Apache Spark
PPTX
Introduction to real time big data with Apache Spark
PPTX
Morning at Lohika
Morning 3 anniversary
Distinguish Pop from Heavy Metal using Apache Spark MLlib
Introduction to ML with Apache Spark MLlib
Morning at Lohika 2nd anniversary
Confession of an Engineer
Influence. The Psychology of Persuasion (in IT)
JEEConf 2015 - Introduction to real-time big data with Apache Spark
Introduction to real time big data with Apache Spark
Morning at Lohika

Recently uploaded (20)

PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
Cloud computing and distributed systems.
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Encapsulation theory and applications.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
A Presentation on Artificial Intelligence
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Modernizing your data center with Dell and AMD
Unlocking AI with Model Context Protocol (MCP)
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Cloud computing and distributed systems.
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Encapsulation theory and applications.pdf
Approach and Philosophy of On baking technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
The Rise and Fall of 3GPP – Time for a Sabbatical?
NewMind AI Weekly Chronicles - August'25 Week I
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Understanding_Digital_Forensics_Presentation.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Big Data Technologies - Introduction.pptx
Spectral efficient network and resource selection model in 5G networks
Encapsulation_ Review paper, used for researhc scholars
A Presentation on Artificial Intelligence
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Modernizing your data center with Dell and AMD

New life inside monolithic application

  • 1. New Life inside Monolithic Application This presentation will be useful to those who would like to get acquainted with lifetime history of successful monolithic Java application By Taras Matyashovsky Taras Matyashovsky, Software Engineer/Team & Tech Lead, CSM, @tmatyashovsky
  • 3. About me • Software engineer/TL • Worked for outsource companies, product companies and tried myself in startups/freelancing • 8+ years production Java experience • Fan of Agile methodologies, CSM • Founder of Morning@Lohika tech talks in Lviv Introduction
  • 4. This Presentation • shows architectural and technical evolution of one Java web startup that is beyond daily coding routine • contains a lot of • simplifications • Captain Obvious • internet memes Introduction
  • 5. Notice • business domain is not important • this presentation is not intended for monolithic vs. micro services architectures comparison Introduction
  • 6. Agenda • You’ve decided to build a startup • You’ve built a startup • Early issues • Solutions • Still not enough • New solution • Proof of concept • New life inside monolith • Next goals • Groupon way • Conclusions • Instead of epilogue Introduction
  • 7. You’ve Decided to Build a Startup
  • 8. You’ve Decided to Build a Startup about 5 years ago You’ve decided to build a startup
  • 9. Product Overview • business model – B2B •main product flow: • import data from customer • process data, e.g. validate, filter, pre-calculate • show different analytics to end users You’ve built a startup
  • 10. Technology Stack 4-5 years ago you’ve probably have chosen: • Java 6.x • JDBC/Hibernate • Spring with emphasis on Spring MVC • HTML/CSS/JSP • JS/jQuery • MySQL 5.x You’ve built a startup
  • 11. Tools 4-5 years ago you’ve probably have chosen: • Maven 2.x • Jetty 6.x • Jenkins • Subversion • JIRA • Confluence You’ve built a startup
  • 12. You’ve Built a Startup You’ve built a startup
  • 13. Architecture Not thinking about: •scalability •performance • customization • l10n, i18n You’ve built a startup
  • 14. SaaS Maturity Model (Level 2) You’ve built a startup
  • 18. You’ve Built a Startup Single tenant monolithic stateful application with no thought on cost of future scalability, customization, l10n/i18n and performance You’ve built a startup
  • 19. You’ve Built a Startup with reasonable trade-offs and compromises You’ve built a startup
  • 20. You’ve Built a Startup And it became a successful product You’ve built a startup
  • 22. Internal Quality •time to market vs. internal quality •business logic becomes more and more complicated Early Issues
  • 23. A Lot of Customers •each customer wants specific features •seamless integration •l10n, i18n Early Issues
  • 25. Issues => Challenges Early Issues
  • 27. Internal Quality “A well-written program is a program where the cost of implementing is constant thought-out the project lifetime” Solutions
  • 28. Internal Quality •formal code review process via Atlassian Crucible •integration with CheckStyle/PMD with strict set of rules Solutions
  • 29. Internal Quality •unit/integration tests •functional tests bases on htmlunit/jwebunit written and maintained by developers Solutions
  • 30. Internal Quality •automation tests framework based on Ruby/Selenium/Cucumber written and maintained by QA engineers •performance tests using NewRelic Solutions
  • 31. A Lot of Customers Still continue with maturity level 2 and tackle customization, i18n, l10n problems separately Solutions
  • 32. Maturity Level 2 Solutions
  • 33. Internal Customization •is implemented via hierarchy of application.properties files Solutions
  • 34. Ruby Scripts • start application per default “demo” customer • start application in debug mode • start application per specific customer using local/remote db • load fixtures data to main/test local database • start application in web tests mode • run specific web test Solutions
  • 35. Specific Features •created additional Spring contexts per customer •introduced unique Spring beans per customer and injected them via aliases Solutions
  • 36. External Customization • each customer had specific static assets, e.g. styles, images, js, etc. • Sass framework was used to reasonably generate CSS files per customer Solutions
  • 37. Storage •one database schema per all customers •patches per customer during deployment Solutions
  • 38. Code Organization •maintained one repository for default “demo” customer •created separated repositories per each customer Solutions
  • 39. Customer Repo Contains: • java files • Spring contexts • database patches • static assets, e.g. styles, images, tags, etc. Web app for each customer is unpackaged and customized at deploy time Solutions
  • 40. So •code and product complexity is controlled in certain bounds •internal product quality is high Solutions
  • 41. So •build, testing, deployment, customization, localization processes are automated Solutions
  • 42. Summary Successful product that overgrew startup stage and is delivered to more than 90 customers all over the globe Solutions
  • 44. Business Issues •customization is limited • as business domain is unique product is hard to be sold to more than 1 customer in region/country Still not Enough
  • 45. DevOps Issues •high maintenance cost •not effective utilization of resources Still not Enough
  • 46. Engineering Issues •it is impossible to develop/test new features without the entire stack running •high cost for even tiny change Still not Enough
  • 47. Unfortunately Current application is expensive to maintain, customize and configure Still not Enough
  • 49. New Solution Redesign existing web solution as a multi-tenant widget-based application with easier customization and configuration support New Solution
  • 50. •lower maintenance cost •easier customization via configuration and static assets that can be re-deployed without releasing software Goals New Solution
  • 51. Goals •modular architecture with well-defined contracts •split of front-end and back-end with possibility to easily provide public API New Solution
  • 53. Vision Z 1.2.4 Widget YX 21.0.01 WWiiddggeett YZ 12..20..30 New Solution Widget Container X 1.0.0 1 Container 2 Container 3
  • 54. Skeleton •will describe header, footer, as well as main page loader •unique per application New Solution
  • 55. Page Layout •will be defined via templates that describe containers in which appropriate widgets will be loaded New Solution
  • 56. Widget •separated web application representing some major feature of application New Solution
  • 57. Widget • is a consolidation of html, css, js plus all necessary images and localized message properties • is going to be stored on static assets server • should be built according to unified web application framework New Solution
  • 58. Targeting API •will provide data essential to build page layout based on a template with widgets to be loaded in particular containers New Solution
  • 59. Sequence Diagram HTML Skeleton Common (branded) CSS Common Code: • targeting call • page layout New Solution Static Content Server CDN Layout / Targeting API Widget Specific API(s) Widget HTML Widget CSS Widget Code 1 3 2 4
  • 60. Looks Great New Solution
  • 62. Nuance That should be done in parallel with the existing application development New Solution
  • 63. Nuance One proof-of-concept widget with corresponding APIs should be implemented to prove future architecture New Solution
  • 65. Widgets Technology Stack • Angular • Node.js • Bower • Grunt • Karma (ex. Testacular), Mocha, Jasmine, PhantomJS • Additional custom libraries for mocking and localization were also built Proof of Concept
  • 66. API Technology Stack Created essential APIs inside existing web application using: • Spring Restful services • Spring rest template/JSON assert for testing Proof of Concept
  • 67. Targeting API • provides targeting page layout for particular customer and logged-in user • provides information if user is currently logged in • provides authentication endpoint URL • provides static assets endpoint URL Proof of Concept
  • 68. Authentication API •is used by page loader to force user authentication Proof of Concept
  • 69. Static Assets API • handles all GET requests and serves up static assets either from file system or from Amazon S3 • combines expiration and validation caching strategies, supports gzipping Proof of Concept
  • 70. Current Sequence Diagram Monolithic Web App Page Loader Common (branded) CSS Common Code: • dependencies • client for targeting API • client for authentication API Proof of Concept Static Content Server CD N Static Assets API Layout / Targeting API Widget Specific API(s) Widget HTML Widget CSS Client for Widget API Authentication API Redesigned Page 1 2 3 4 5 6
  • 71. New Life inside Monolith
  • 72. Temporary Architecture New Life inside Monolith
  • 73. New Approach •one widget in production using described APIs that live inside existing monolith •web framework for front-end developers to build more widgets New Life inside Monolith
  • 74. So Selected architecture, technology stack and tools were proven New Life inside Monolith
  • 76. Next Goals •improve web framework, e.g. repository management, end to end tests, etc. •rebuild other pages using widgets approach when needed Next Goals
  • 77. Next Goals •dismantle the monolith using SOA-like services •create mobile clients connected to redesigned unified API Next Goals
  • 80. •migrated frontend from Ruby to Node.js infrastructure •the old monolithic frontend was split up into ~20 separate web apps Groupon Way “Dismantling the Monoliths”
  • 81. •ability to deploy changes to applications independently •ability to make site-wide feature and design changes much more quickly Groupon Way “Dismantling the Monoliths”
  • 84. Conclusions •monolithic applications can be successful Conclusions
  • 85. Conclusions •you should have a good reasons for dismantling as well as for choosing micro services architecture Conclusions
  • 86. Conclusions •gradual dismantling the monolithic application is doable Conclusions
  • 89. A Good Architecture Enables Agility By Simon Brown, @simonbrown, http://www.simonbrown.je/
  • 90. Just Think If you can’t build a structured monolith what makes you think micro services is the answer? Don’t blindly copy what everybody else seems to be doing By Simon Brown, @simonbrown, http://www.simonbrown.je/
  • 91. Monolith vs. Micro Services By Aviran Mordo, https://twitter.com/aviranm/status/531925339518148609/photo/1
  • 92. Monolith vs. Micro Services Instead of Epilogue
  • 93. Thanks! Questions? New Life inside Monolithic Application by Taras Matyashovsky Design by
  • 94. References • http://martinfowler.com/articles/microservices.html • http://www.infoq.com/news/2014/08/microservices-monoliths • http://www.infoq.com/news/2014/08/microservices_ballmud • http://www.infoq.com/presentations/development-deployment-collaboration-etsy • https://twitter.com/aviranm/status/531925339518148609/photo/1 • https://thecloudworld.wordpress.com/tag/maturity-model/ • http://highscalability.com/blog/2014/7/28/the-great-microservices-vs-monolithic- apps-twitter-melee.html • http://www.codingthearchitecture.com/presentations/devday2014-software-software- architecture-vs-code • http://www.simonbrown.je/ • https://engineering.groupon.com/2013/misc/i-tier-dismantling-the-monoliths/ References

Editor's Notes

  • #34: introduced notion of host, tier (local, dev, qa, stage, prod), client (i.e. customer) created hierarchy of application.properties files and corresponding values that were capable to change behavior of the application for specific host/tier/client provided correct general (default) values as well as client specific per each host/tier that will be overridden during deployment
  • #35: Pure Maven was not enough now to easily support such differentiation of application startup.
  • #36: Some customers required existing functionality to behave differently as well as some specific new functionality.
  • #37: Sass framework was used in order to reasonably generate CSS files per client using variables, nesting, imports, inheritance, etc.
  • #38: one database schema per all customers, but some customers needed additional tables, columns, etc. created an internal tool capable of automated execution of some patches to the existing schema per customer during deployment
  • #51: lower maintenance cost easier support for "standard" customizations via configuration that can be re-deployed without releasing software easier support for "extended" customization by enforcing a modular architecture with well-defined contracts separated front-end from back-end API move from single-tenancy to multi-tenancy
  • #52: lower maintenance cost easier support for "standard" customizations via configuration that can be re-deployed without releasing software easier support for "extended" customization by enforcing a modular architecture with well-defined contracts separated front-end from back-end API move from single-tenancy to multi-tenancy
  • #57: Web application framework should be built that would include common features needed by each widget to make it easy for front-end developers to build out these individual web apps with maximum isolation from current stack and back-end engineers
  • #58: Web application framework should be built that would include common features needed by each widget to make it easy for front-end developers to build out these individual web apps with maximum isolation from current stack and back-end engineers
  • #59: will be single point of knowledge whether use default message properties or client specific, file structure on static assets server, locale to be used by end-user, etc.
  • #67: Benefits: reused existing SSO solution
  • #68: provides targeting site layout for particular customer and logged-in user in multi-tenant environment as well as targeting site layout for current customer in single-tenant environment provides information if currently user is currently logged in provides URL that should be used to authentication provides URL for static assets endpoint
  • #71: 1. visit redesigned widget-based page that has URL under static assets endpoint, e.g. static_assets/redesigned_page. Static assets API will provide page loader if resource is not found. 2. fetch page loader including common skeleton, css customized per customer, common dependencies, clients for main APIs 3. call the targeting API to figure out what tabs to show and what widget to use 4. if widget requires user to be logged in then perform authentication via authentication API 5. fetch widget assets, e.g. markup, css, message properties, client for specific API 6. widget will make further calls to widget specific APIs in order to get data
  • #74: one widget in production using described APIs that live inside existing monolith web framework that includes common features needed by each widget to make it easy for front-end developers to build out these widgets with isolation from current stack and back-end engineers