DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Java Microservices [Tutorials and Articles]
  • 7 Microservices Best Practices for Developers
  • Spring Reactive Microservices: A Showcase
  • Microservices Implementation: Software Stacks and Concepts

Trending

  • How to Migrate Vector Data from PostgreSQL to MyScale
  • An Introduction to Build Servers and Continuous Integration
  • Unveiling Vulnerabilities via Generative AI
  • DevOps Uses a Capability Model, Not a Maturity Model
  1. DZone
  2. Data Engineering
  3. Databases
  4. Why 12 Factor Application Patterns, Microservices and CloudFoundry Matter (Part 2)

Why 12 Factor Application Patterns, Microservices and CloudFoundry Matter (Part 2)

Learn why 12 Factor Application Patterns, Microservices and CloudFoundry matter when trying to change the way your product is produced.

Tim Spann user avatar by
Tim Spann
CORE ·
Jun. 12, 15 · Interview
Like (4)
Save
Tweet
Share
14.80K Views

Join the DZone community and get the full member experience.

Join For Free

I first described a difficult scenario that I faced a few years ago.  This article is my recommendations to the current custodians of that project on what to change and how.

With the help of open source frameworks like Spring Cloud and open source platforms like Cloudfoundry, you aren’t forced into having a fragile, manual SDLC.  The first step is to embrace change and join a vibrant community that is succeeding in software development.

Overview

  • Increase agility through process, tools and culture
  • Examine the code and depedencies, determine modules based on business domain.
  • Refactor the monolithic EAR into microservices living in JARs guided by the 12 Factor Application patterns and microservices recommendations.
  • 12FA – III – Store configuration in the environment (or even better use a configuration server)
  • Change the Development Process, Frameworks, Libraries and Tools.
  • Change the Build Process and Tools.  Embrace Gradle, Maven, JDK 8.
  • Change the Delivery Process.  Enact Continuous delivery.
  • Change the Database modifications and migration Process and Tools.
  • Change the run-time platform from legacy application server to a PaaS.
  • Centralize the logging.  Using PCF Loggregator and tools like ELK and PaperTrail.
  • Embrace industry standard open source tools, libraries and frameworks
  • Good code fails when you don’t have good process and a platform to help you.
  • Good teams fail when you don’t have a good culture that embraces DevOps, microservices and not giant monoliths.

So how could we have improved our process?  The first step is to admin you have a problem and seek help. By looking to the community, open source and successful startups that have faced similar struggles with monolithic J2EE code bases (Ebay, Netflix), we can determine some functional patterns.

Patterns and Principles for Change

  • Use Jenkins to deploy your app with no downtime to CloudFoundry.
  • Use CloudFoundry deployments to do A/B testing with no downtime or difficulty.
  • Bind to database, using the same process in development, test, Q/A and production.  No manual configuration or configuration changes.  Operators make available the correct database settings through the marketplace.  Same manifest and bindings will point to different databases in different spaces.
  • To migrate database changes use flywaydb or liquibase.  These are very well integrated into Spring Boot.
  • Look at NoSQL for part of your database workload, polyglot persistence makes sense in many cases.  For MongoDB development, you handle change management with Mongeez, which is automatically done with JHipster.
  • Smoke tests and automated tests tied to Jenkins.
  • Test against CloudFoundry development for local development, fast deployments, run unit and integration tests locally.
  • Use Maven or Gradle for builds, not ANT.
  • Use Circuit breakers in your web calls to avoid breaking systems and fail safely.
  • Use APM and JMX for deep checks using Pivotal Ops Metrics for CloudFoundry.
  • Have automated scripts check one log stream.  Use tools like ELK (ElasticSearch+Logstash+Kibana) to examine logs.
  • Use CloudFoundry containers that don’t make you SSH to many machines, removing a big manual step that could be a security issue.
  • Move to using smaller, lighterweight Spring Boot Jars and Wars; not giant EAR files.
  • Use lightweight web containers like Jetty, Tomcat, tcServer, or Undertow.
  • Use lightweight frameworks, remember YAGNI and KISS.
  • Read and embrace:  Release It!
  • Break up the apps into smaller, logical components that model real business functionality.
  • Refactor existing code guided by tests, enhancing and adding more tests as the code evolves.  Remembering to use code coverage tools like Jacoco.
  • Design clean RESTful APIs guided by SRP (Single Responsibility Principle).
  • Use smart, modern opinionated frameworks for development like Spring Boot, DropWizard and RatPack.
  • Install GVM and use it to install SpringBoot, Gradle, Groovy, LazyBones and other great tools.  example:  gvm install springboot
  • Use Spring Cloud Connectors, Spring Cloud Netflix projects for Service Discovery and other useful services to enable microservices orchestration and development.
  • Use a very helpful application generator like JHipster.
  • Use Domain Driven Design.
  • Keep to the basics of OOD for existing code and Functional Reactive Programming for new code.
  • Document your API with Spring REST Docs or Swagger.  There is a great presentation on that here.
  • Start your green field projects with one button click or use the Spring CLI (spring init -d=web,data-jpa,actuator,data-rest –build=maven newappdir/).

References

  • http://www.agilemobiledeveloper.com/2014/12/29/critical-tools/
  • http://www.agilemobiledeveloper.com/2015/01/05/tools-for-crushing-high-availability-and-scalability-part-i/

Service Discovery

  • http://www.infoq.com/articles/russ-miles-antifragility-microservices
  • http://www.slideshare.net/ewolff/java-application-servers-are-dead
  • http://www.slideshare.net/Pivotal/wed-1630-breakoutvinicius
microservice application Spring Framework Open source Spring Cloud Database Factor (programming language)

Published at DZone with permission of Tim Spann, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Java Microservices [Tutorials and Articles]
  • 7 Microservices Best Practices for Developers
  • Spring Reactive Microservices: A Showcase
  • Microservices Implementation: Software Stacks and Concepts

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: