Konzeption und Umsetzung eines Ansatzes zur Identifikation von Antipattern in Microservice-Architekturen
von Fabian Lemke

Agenda

  1. Antipattern
  2. Erweiterung LEMMA
  3. Proof of Work
  4. Ausblick

Dokument

Download
Abgegebener Stand der Bachelorthesis

Antipattern

VODY

Zirkelbezug

Versionierung


Semantic Versioning

Service Intimität

Größenordnung

  • Größe
  • Komplexität
  • Technologievielfalt
  • ...

Anpassungen

Kategorisierung


							enum class AntipatternType(val displayName: String) {
								API_VERSIONING("API-Versioning"),
								CYCLIC_DEPENDENCY("Cyclic Dependencies"),
								USAGE_ESB("Usage Enterprise Service Bus"),
								HARDCODED_ENDPOINTS("Hardcoded Endpoints"),
								NO_API_GATEWAY("No API-Gateway"),
								SHARED_PERSISTENCE("Shared Persistence"),
								LOCAL_LOGGING("Local Logging"),
								NO_MONITORING("Missing Monitoring"),
							}

							data class Antipattern(
								val type: AntipatternType, 
								val message: String)
						

							interface AntipatternOperationAnalyzerStrategy {
								fun analyzeOperationNodes
									(nodes: Iterable<IntermediateOperationNode>): 
										Collection<Antipattern>
							}
						

							interface AntipatternServiceAnalyzerStrategy {
								fun analyzeOperationNodes
									(microservices: Iterable<IntermediateMicroservice>): 
									Collection<Antipattern>
							}
						

							private var strategies = setOf(
								CircleStrategy(),
								WrongAspectStrategy("ESB", AntipatternType.USAGE_ESB, "Using an 'Enterprise Service Bus' can make a solution too complex"),
								MissingAspectStrategy("ServiceDiscovery", AntipatternType.HARDCODED_ENDPOINTS, "A service discovery should be used"),
								AspectUsageStrategy("Database", AntipatternType.SHARED_PERSISTENCE, "Only one Service should access a data storage. In case of data separation, like different tables this can be ignored"),
								MissingAspectStrategy("LogServer", AntipatternType.LOCAL_LOGGING, "Log-Data should be stored central"),
								MissingAspectStrategy("Monitoring", AntipatternType.NO_MONITORING, "Services should be monitored central"),
								MissingAspectStrategy("API-Gateway", AntipatternType.NO_API_GATEWAY, "Although the service has endpoints no API-Gateway is connected", true)
							)
						

							override fun checkExistingAntipattern(): Collection{
								val allInfrastuctureNodes = Cache.allInfrastuctureNodes()
								val allContainer = Cache.allContainer()
								val operationNodes = mutableListOf()
								operationNodes.addAll(allContainer)
								operationNodes.addAll(allInfrastuctureNodes)
								val result = mutableListOf()
								strategies.forEach { result.addAll(it.analyzeOperationNodes(operationNodes)) }
								return result
							}
						

Proof of Work

Analyse von VODY

Modelle auf GitHub

Livedemo

Backup


							*************************************************************
							Antipattern analysis result - Type: Service
							*************************************************************
							No potential antipatterns identified. Everything seems to be clean.
						

Backup


							*************************************************************
							Antipattern analysis result - Type: Operation
							*************************************************************
							Disclaimer: Identified Antipattern are not always bad practices, but can be a hint!
							~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
							Statistic - Identified antipatterns
							~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
							Hardcoded Endpoints:	 1

							~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
							List - All identified antipatterns
							~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
							Hardcoded Endpoints:	 A service discovery should be used. Object MonitoringAndLogging has no connection to a Operation-Node with ArchitecturePattern-Aspect and name 'ServiceDiscovery'
						

Statistik

  • 21 Antipattern insgesamt in Literatur [POF22]
  • 14 Antipattern genauer betrachtet
  • Analyselogik für 9 Antipattern

Fazit/Ausblick

ArchitecturePattern mit standardisierten Typen ablösen

							technology Foo{
								// ...
								operation aspects {
									aspect ArchitecturePattern for infrastructure{
										string name <mandatory>; 
									}
								}
							}
						

Zum Abschluss

Pull Request

https://github.com/SeelabFhdo/lemma/pull/58