Weeding your micro service landscape.pdf

timtebeek1 24 views 32 slides May 16, 2024
Slide 1
Slide 1 of 32
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32

About This Presentation

New microservices often start from reference templates of other microservices. But when those copies drift apart, your landscape grows wild and becomes difficult to maintain. How do you now whip your landscape back into shape?


Slide Content

Weeding your micro
service landscape
JCON Europe 2024

©2024 Moderne, Inc. 2

©2024 Moderne, Inc. 3

©2024 Moderne, Inc. 4
Only see current state
Copies of copies of copies
Similarities show common origin
Differences hint at diverging lineage

Patterns in biology

©2024 Moderne, Inc. 5
Only see current state
Copies of copies of copies
Similarities show common origin
Differences hint at diverging lineage

Patterns in software engineering

©2024 Moderne, Inc. 6
CI & deployments are conserved
Hard to survive if you can’t deploy
Database drivers & access co-evolve
Controller endpoints highly variable
Adapt to new purpose
Evolutionary drift
Differences without purpose
Experimentation
Deliberate mutations
Patterns in software engineering

©2024 Moderne, Inc. 7
Why should you care?

©2024 Moderne, Inc. 8
Easy switch between projects
Invest in tooling
1% improvement X projects affected
Maximum impact
Standardization is good

©2024 Moderne, Inc. 9
Helps you evolve
New techniques, libraries,
frameworks, features
Promote successful experiments
Learn from failure
Don’t get stuck in past
Experimentation is good

©2024 Moderne, Inc. 10
Unintentional changes
serve no purpose
Difficult to switch between projects
Hinders innovation
Less effective applying broad changes
Drift is bad

©2024 Moderne, Inc. 11

©2024 Moderne, Inc. 12
A proposed fix

©2024 Moderne, Inc. 13
Who here has heard of OpenRewrite?

©2024 Moderne, Inc. 14
Who here has used OpenRewrite?

©2024 Moderne, Inc. 15
Who here has heard of Moderne?

©2024 Moderne, Inc. 16
Core technology concepts
Lossless Semantic Tree (LST) full-fidelity
representation of source code with type
attribution and formatting
OpenRewrite ecosystem of
deterministic recipes with >2000
recipes available out-of-the box
1,000s of precision search and
modernization recipes—all part of the
OpenRewrite ecosystem. Plus,
organizations can build custom recipes.
Lossless Semantic Tree (LST) code
representation characterized by
type attribution, format preservation,
and other metadata.
+ many more!
DATA PROGRAMS

©2024 Moderne, Inc.
17
What real, automated code remediation looks like
No longer define an
expected exception on
the ‘@Test’ annotation
Auto-refactoring relocates
the original contents into a
lambda argument in an
‘assertThrows’ call and
formats per existing code
style
EXAMPLE: JUnit 4 to 5 migration: “assertThrows” call added to the test’s method body
Accurate code changes that match the local code style across 1,000s of repositories.

©2024 Moderne, Inc. 18
Manage technical debt at scale
Examples
Security vulnerability
remediation across a
growing attack surface
Eradicate OWASP Top 10 vulnerabilities
immediately across a codebase with in-depth
code analysis and auto-repair. Upgrade
vulnerable dependencies automatically.
Software
architect
Software migration
engineering coordinating
among repositories
Migrate from Java 8 to 11 to Java 17 to Java 21
in all relevant repositories and infrastructure.
Eliminate vendor lock-in by automating
technology changes—for example, from one
database to another.
Security
engineer
Improving code quality
and compliance
across an organization
Repair SAST issues automatically (reported
by SonarQube, FindBugs, HP Fortify, etc.).
Keeping code clean all the time makes it
easier to work with and maintain.
Developer
Developers drive the
automation to
analyze and fix
source code across
multiple repos.

Moderne replaces
insurmountable
hours of manual
work—making 100%
accurate code
changes that are
easy to review and
commit.
What Moderne does

©2024 Moderne, Inc. 19
Look at our landscape

©2024 Moderne, Inc.
Outdated versions
of frameworks & Java
Abandoned libraries
beyond your control
Time to move away
from the library (not the company)
Changed coordinates
Codehaus, Jakarta
Vulnerable dependencies
20
Looking ahead, not looking back
Dependency drift

©2024 Moderne, Inc. 21
Demo IntelliJ

©2024 Moderne, Inc. 22
Missing or outdated wrappers
Outdated or unversioned plugins
Dead, or http:// repositories
Prefixless expressions ${artifactId}
POM code convention
Enable parallelization
Add Develocity extension
Build tools
Missing or outdated wrappers
Outdated or unversioned plugins
Dead, or http:// repositories
14+ ways for dependency versions
Enable build cache
Enable parallelization
Add Develocity plugin

©2024 Moderne, Inc. 23
Demo Moderne Platform

©2024 Moderne, Inc. 24
Switch base images
Additional scanners
Automated code checks
Graceful shutdown
/health, /liveness, /readiness
apiVersion: extensions/v1beta1
Capture metrics
Set resource limits
Tons of quick wins
CI & deployments

©2024 Moderne, Inc. 25
Apply formatter
.gitignore files
Clean up .DS_Store & .idea files
Resolve static analysis issues
Phase out old feature flags
Small sources of friction
General clean ups

©2024 Moderne, Inc. 26
Demo Moderne CLI

©2024 Moderne, Inc. 27
Moderne scales OpenRewrite automation
Single-repository mode Multi-repository mode
OpenRewrite
OSS Project
Serialize LSTs
to disk
OpenRewrite
Gradle Plugin
OpenRewrite
Maven Plugin
Spring Boot
Migrator
Amazon Q
Code
Transformation
JetBrains
OpenRewrite
Plugin
Microsoft
VSCode Plugin
Moderne
Platform
Moderne CLI
Single-
tenant
SaaS
On-prem
Moderne
proprietary IP
Moderne DX
Air-gapped
service
Shared OSS recipe ecosystem
Codemods, linters, & other refactoring tech

©2024 Moderne, Inc. 28
Collaborating across the enterprise codebase
Moderne DevCenter to always know the
state of your code and take action.
Code visualizations for
understanding your code
like never before.
Code analysis and
recipe
recommendations
Activity
tracking and
coordination
Risk profile of
vulnerabilities plus
available fixes

©2024 Moderne, Inc. 29
Standardize to go fast
Experiment to evolve
Reflect, learn & nurture
Root out to stay healthy
Automate what you can
Takeaways

©2024 Moderne, Inc. 30
Your own recipe library
github.com/moderneinc/rewrite-recipe-starter

docs.moderne.io/user-documentation/
workshops/recipe-authoring

©2024 Moderne, Inc. 31
Where to learn more
docs.openrewrite.org
github.com/openrewrite
youtube.com/@moderne-auto-remediation
moderne.io

©2024 Moderne, Inc. 32
Continuously build a better and more secure codebase.

Danke sehr!