Table of content



4. Migration of the architecture type for Shop

The data schema Shop supports 163 interface methods. Both, the monolith and the microservice architecture supports all of the service interface methods. Because of this fact, the monolith can be exchanged by the microservice architecture without breaking the API for the user applications such as web or mobile applications. This allows architects to switch from a monolithic architecture in the beginning of the application lifetime to a microservice architecture, if the demand for the abilities of a microservice architecture rise over time. This could be the case, if the amount of users rises more and more. If features like availabilty, scalability or independent deployability of application parts become important. this could be a reason to leave the monolithic architecture to a microservice architecture for the price of a much higher system complexity. Local ACID based transactions should be taken instead of complex global transactions whereever this is also possible in a distributed microservice architecture. The monolith connects to one big global database schema with 26 entities. The microservice architecture consists of 4 microservices where each service connects only to one local database schema. Each of the 26 entities can only be written by one microservice, that is the master for this entity. The entity can also be part of other local schemas in other microservices. But these microservices only get a copy of the master microservice entity via a message broker. The copy of the entity arrives in those microservices with a latency time. Only after this entity copy has been integrated in all other local databases, the whole system is a consistent state. Within the latency time, the system is only eventually consistent. Systems, that depend to a hundred percent on a consistent state, must use the synchrounous calls over the API of the microservices and should not use the copies that arrive via the asynchrounous message broker.


Monolith architecture for the Shop application


Microservice architecture for schema Shop


Service Interfaces

Relative mapping URLRequest MethodMethod NameMicroserviceInvolved Entities
/warehouse/country/{id}GETfindAllWarehouseOfCountry(id)CountryServiceCountry Warehouse
/discountcampaignGETfindAllDiscountCampaign()DiscountCampaignServiceDiscountCampaign
/purchaseruleGETfindAllPurchaseRule()ProductServicePurchaseRule
/shoplicensePOSTinsertShopLicense(shoplicense)ShopLicenseServiceShopLicense
/customergroupPOSTinsertCustomerGroup(customergroup)CountryServiceCustomerGroup
/productprice/{id}PUTupdateProductPriceById(productprice)ProductServiceProductPrice
/purchaserule/{id}PUTupdatePurchaseRuleById(purchaserule)ProductServicePurchaseRule
/customerdelivery/orderitem/{id}GETfindAllCustomerDeliveryOfOrderItem(id)ProductServiceOrderItem CustomerDelivery
/country/{id}PUTupdateCountryById(country)CountryServiceCountry
/deliveryGETfindAllDelivery()CountryServiceDelivery
/orderitem/{id}DELETEdeleteOrderItemById(id)ProductServiceOrderItem
/deliveryPOSTinsertDelivery(delivery)CountryServiceDelivery
/productcategoryPOSTinsertProductCategory(productcategory)ProductServiceProductCategory
/shopemployee/{id}GETfindShopEmployeeById(id)CountryServiceShopEmployee
/discounttype/{id}PUTupdateDiscountTypeById(discounttype)DiscountCampaignServiceDiscountType
/discountcampaigncustomer/{id}DELETEdeleteDiscountCampaignCustomerById(id)CountryServiceDiscountCampaignCustomer
/country/{id}GETfindCountryById(id)CountryServiceCountry
/productcategory/{id}PUTupdateProductCategoryById(productcategory)ProductServiceProductCategory
/discountcampaigncustomergroup/{id}PUTupdateDiscountCampaignCustomerGroupById(discountcampaigncustomergroup)DiscountCampaignServiceDiscountCampaignCustomerGroup
/discountcampaigncustomergroup/customergroup/{id}GETfindAllDiscountCampaignCustomerGroupOfCustomerGroup(id)DiscountCampaignServiceCustomerGroup DiscountCampaignCustomerGroup
/productcategory/{id}GETfindProductCategoryById(id)ProductServiceProductCategory
/productdelivery/distributor/{id}GETfindAllProductDeliveryOfDistributor(id)ProductServiceDistributor ProductDelivery
/discounttype/{id}DELETEdeleteDiscountTypeById(id)DiscountCampaignServiceDiscountType
/discounttype/{id}GETfindDiscountTypeById(id)DiscountCampaignServiceDiscountType
/salestax/{id}DELETEdeleteSalesTaxById(id)ProductServiceSalesTax
/customerorder/shopcustomer/{id}GETfindAllCustomerOrderOfShopCustomer(id)CountryServiceShopCustomer CustomerOrder
/salestax/country/{id}GETfindAllSalesTaxOfCountry(id)ProductServiceCountry SalesTax
/shopowner/{id}GETfindShopOwnerById(id)ShopLicenseServiceShopOwner
/warehousePOSTinsertWarehouse(warehouse)CountryServiceWarehouse
/shopemployee/{id}PUTupdateShopEmployeeById(shopemployee)CountryServiceShopEmployee
/customerdelivery/{id}PUTupdateCustomerDeliveryById(customerdelivery)ProductServiceCustomerDelivery
/warehouseresponsibility/warehouse/{id}GETfindAllWarehouseResponsibilityOfWarehouse(id)CountryServiceWarehouse WarehouseResponsibility
/shopcustomer/{id}DELETEdeleteShopCustomerById(id)CountryServiceShopCustomer
/customerorderGETfindAllCustomerOrder()CountryServiceCustomerOrder
/shopemployee/{id}DELETEdeleteShopEmployeeById(id)CountryServiceShopEmployee
/discounttypePOSTinsertDiscountType(discounttype)DiscountCampaignServiceDiscountType
/product/countryoforigin/{id}GETfindAllProductOfCountryOfOrigin(id)ProductServiceCountry Product
/distributor/{id}GETfindDistributorById(id)ProductServiceDistributor
/delivery/shopcustomer/{id}GETfindAllDeliveryOfShopCustomer(id)CountryServiceShopCustomer Delivery
/shopcustomer/{id}GETfindShopCustomerById(id)CountryServiceShopCustomer
/countryGETfindAllCountry()CountryServiceCountry
/discountcampaign/{id}DELETEdeleteDiscountCampaignById(id)DiscountCampaignServiceDiscountCampaign
/customergroupmemberGETfindAllCustomerGroupMember()CountryServiceCustomerGroupMember
/productprice/product/{id}GETfindAllProductPriceOfProduct(id)ProductServiceProduct ProductPrice
/distributor/{id}PUTupdateDistributorById(distributor)ProductServiceDistributor
/warehouse/{id}GETfindWarehouseById(id)CountryServiceWarehouse
/shopemployeeGETfindAllShopEmployee()CountryServiceShopEmployee
/productcategory/{id}DELETEdeleteProductCategoryById(id)ProductServiceProductCategory
/customerdeliveryPOSTinsertCustomerDelivery(customerdelivery)ProductServiceCustomerDelivery
/shopcustomerPOSTinsertShopCustomer(shopcustomer)CountryServiceShopCustomer
/discountcampaigncustomer/discountcampaign/{id}GETfindAllDiscountCampaignCustomerOfDiscountCampaign(id)CountryServiceDiscountCampaign DiscountCampaignCustomer
/discountcampaignproductcategoryGETfindAllDiscountCampaignProductCategory()DiscountCampaignServiceDiscountCampaignProductCategory
/warehouseresponsibility/shopemployee/{id}GETfindAllWarehouseResponsibilityOfShopEmployee(id)CountryServiceShopEmployee WarehouseResponsibility
/discounttypeGETfindAllDiscountType()DiscountCampaignServiceDiscountType
/purchaserule/{id}DELETEdeletePurchaseRuleById(id)ProductServicePurchaseRule
/customerdelivery/{id}GETfindCustomerDeliveryById(id)ProductServiceCustomerDelivery
/country/{id}DELETEdeleteCountryById(id)CountryServiceCountry
/warehouse/{id}PUTupdateWarehouseById(warehouse)CountryServiceWarehouse
/customergroup/{id}DELETEdeleteCustomerGroupById(id)CountryServiceCustomerGroup
/product/salestax/{id}GETfindAllProductOfSalesTax(id)ProductServiceSalesTax Product
/discountcampaigncustomer/shopcustomer/{id}GETfindAllDiscountCampaignCustomerOfShopCustomer(id)CountryServiceShopCustomer DiscountCampaignCustomer
/shopemployeePOSTinsertShopEmployee(shopemployee)CountryServiceShopEmployee
/shopowner/{id}PUTupdateShopOwnerById(shopowner)ShopLicenseServiceShopOwner
/productprice/{id}GETfindProductPriceById(id)ProductServiceProductPrice
/warehouseresponsibility/{id}DELETEdeleteWarehouseResponsibilityById(id)CountryServiceWarehouseResponsibility
/productdelivery/{id}PUTupdateProductDeliveryById(productdelivery)ProductServiceProductDelivery
/discountcampaigncustomergroupPOSTinsertDiscountCampaignCustomerGroup(discountcampaigncustomergroup)DiscountCampaignServiceDiscountCampaignCustomerGroup
/shoplicense/{id}GETfindShopLicenseById(id)ShopLicenseServiceShopLicense
/purchaserulePOSTinsertPurchaseRule(purchaserule)ProductServicePurchaseRule
/countryPOSTinsertCountry(country)CountryServiceCountry
/shopcustomer/{id}PUTupdateShopCustomerById(shopcustomer)CountryServiceShopCustomer
/customerdelivery/delivery/{id}GETfindAllCustomerDeliveryOfDelivery(id)ProductServiceDelivery CustomerDelivery
/distributor/{id}DELETEdeleteDistributorById(id)ProductServiceDistributor
/productpricePOSTinsertProductPrice(productprice)ProductServiceProductPrice
/warehouseresponsibility/{id}GETfindWarehouseResponsibilityById(id)CountryServiceWarehouseResponsibility
/discountcampaigncustomerGETfindAllDiscountCampaignCustomer()CountryServiceDiscountCampaignCustomer
/discountcampaignproduct/{id}GETfindDiscountCampaignProductById(id)DiscountCampaignServiceDiscountCampaignProduct
/discountcampaignproductcategoryPOSTinsertDiscountCampaignProductCategory(discountcampaignproductcategory)DiscountCampaignServiceDiscountCampaignProductCategory
/salestaxPOSTinsertSalesTax(salestax)ProductServiceSalesTax
/product/{id}DELETEdeleteProductById(id)ProductServiceProduct
/orderitem/customerorder/{id}GETfindAllOrderItemOfCustomerOrder(id)ProductServiceCustomerOrder OrderItem
/productdeliveryPOSTinsertProductDelivery(productdelivery)ProductServiceProductDelivery
/warehouseGETfindAllWarehouse()CountryServiceWarehouse
/product/{id}PUTupdateProductById(product)ProductServiceProduct
/productdelivery/{id}GETfindProductDeliveryById(id)ProductServiceProductDelivery
/discountcampaigncustomergroupGETfindAllDiscountCampaignCustomerGroup()DiscountCampaignServiceDiscountCampaignCustomerGroup
/orderitemGETfindAllOrderItem()ProductServiceOrderItem
/customerdeliveryGETfindAllCustomerDelivery()ProductServiceCustomerDelivery
/discountcampaignPOSTinsertDiscountCampaign(discountcampaign)DiscountCampaignServiceDiscountCampaign
/purchaserule/{id}GETfindPurchaseRuleById(id)ProductServicePurchaseRule
/discountcampaignproductcategory/{id}GETfindDiscountCampaignProductCategoryById(id)DiscountCampaignServiceDiscountCampaignProductCategory
/productdeliveryGETfindAllProductDelivery()ProductServiceProductDelivery
/warehouseresponsibilityPOSTinsertWarehouseResponsibility(warehouseresponsibility)CountryServiceWarehouseResponsibility
/customergroupmemberPOSTinsertCustomerGroupMember(customergroupmember)CountryServiceCustomerGroupMember
/discountcampaigncustomergroup/{id}DELETEdeleteDiscountCampaignCustomerGroupById(id)DiscountCampaignServiceDiscountCampaignCustomerGroup
/customerorder/{id}GETfindCustomerOrderById(id)CountryServiceCustomerOrder
/discountcampaignproduct/product/{id}GETfindAllDiscountCampaignProductOfProduct(id)DiscountCampaignServiceProduct DiscountCampaignProduct
/distributorGETfindAllDistributor()ProductServiceDistributor
/productcategoryGETfindAllProductCategory()ProductServiceProductCategory
/productdelivery/{id}DELETEdeleteProductDeliveryById(id)ProductServiceProductDelivery
/orderitem/product/{id}GETfindAllOrderItemOfProduct(id)ProductServiceProduct OrderItem
/customergroupmember/customergroup/{id}GETfindAllCustomerGroupMemberOfCustomerGroup(id)CountryServiceCustomerGroup CustomerGroupMember
/shoplicense/{id}DELETEdeleteShopLicenseById(id)ShopLicenseServiceShopLicense
/productdelivery/product/{id}GETfindAllProductDeliveryOfProduct(id)ProductServiceProduct ProductDelivery
/discountcampaignproduct/discountcampaign/{id}GETfindAllDiscountCampaignProductOfDiscountCampaign(id)DiscountCampaignServiceDiscountCampaign DiscountCampaignProduct
/discountcampaigncustomerPOSTinsertDiscountCampaignCustomer(discountcampaigncustomer)CountryServiceDiscountCampaignCustomer
/shopowner/{id}DELETEdeleteShopOwnerById(id)ShopLicenseServiceShopOwner
/discountcampaign/{id}PUTupdateDiscountCampaignById(discountcampaign)DiscountCampaignServiceDiscountCampaign
/discountcampaigncustomer/{id}PUTupdateDiscountCampaignCustomerById(discountcampaigncustomer)CountryServiceDiscountCampaignCustomer
/productprice/{id}DELETEdeleteProductPriceById(id)ProductServiceProductPrice
/discountcampaign/discounttype/{id}GETfindAllDiscountCampaignOfDiscountType(id)DiscountCampaignServiceDiscountType DiscountCampaign
/discountcampaignproduct/{id}PUTupdateDiscountCampaignProductById(discountcampaignproduct)DiscountCampaignServiceDiscountCampaignProduct
/productPOSTinsertProduct(product)ProductServiceProduct
/customerorderPOSTinsertCustomerOrder(customerorder)CountryServiceCustomerOrder
/customergroupmember/{id}GETfindCustomerGroupMemberById(id)CountryServiceCustomerGroupMember
/customergroupGETfindAllCustomerGroup()CountryServiceCustomerGroup
/productprice/country/{id}GETfindAllProductPriceOfCountry(id)ProductServiceCountry ProductPrice
/productdelivery/warehouse/{id}GETfindAllProductDeliveryOfWarehouse(id)ProductServiceWarehouse ProductDelivery
/discountcampaigncustomergroup/{id}GETfindDiscountCampaignCustomerGroupById(id)DiscountCampaignServiceDiscountCampaignCustomerGroup
/salestax/{id}GETfindSalesTaxById(id)ProductServiceSalesTax
/customergroupmember/{id}PUTupdateCustomerGroupMemberById(customergroupmember)CountryServiceCustomerGroupMember
/customerorder/{id}PUTupdateCustomerOrderById(customerorder)CountryServiceCustomerOrder
/warehouseresponsibilityGETfindAllWarehouseResponsibility()CountryServiceWarehouseResponsibility
/orderitem/{id}GETfindOrderItemById(id)ProductServiceOrderItem
/discountcampaigncustomer/{id}GETfindDiscountCampaignCustomerById(id)CountryServiceDiscountCampaignCustomer
/discountcampaignproductcategory/{id}DELETEdeleteDiscountCampaignProductCategoryById(id)DiscountCampaignServiceDiscountCampaignProductCategory
/customerdelivery/{id}DELETEdeleteCustomerDeliveryById(id)ProductServiceCustomerDelivery
/salestax/{id}PUTupdateSalesTaxById(salestax)ProductServiceSalesTax
/discountcampaign/{id}GETfindDiscountCampaignById(id)DiscountCampaignServiceDiscountCampaign
/warehouseresponsibility/{id}PUTupdateWarehouseResponsibilityById(warehouseresponsibility)CountryServiceWarehouseResponsibility
/distributorPOSTinsertDistributor(distributor)ProductServiceDistributor
/discountcampaignproductcategory/{id}PUTupdateDiscountCampaignProductCategoryById(discountcampaignproductcategory)DiscountCampaignServiceDiscountCampaignProductCategory
/discountcampaignproductGETfindAllDiscountCampaignProduct()DiscountCampaignServiceDiscountCampaignProduct
/purchaserule/product/{id}GETfindAllPurchaseRuleOfProduct(id)ProductServiceProduct PurchaseRule
/shoplicense/{id}PUTupdateShopLicenseById(shoplicense)ShopLicenseServiceShopLicense
/delivery/{id}PUTupdateDeliveryById(delivery)CountryServiceDelivery
/shopownerGETfindAllShopOwner()ShopLicenseServiceShopOwner
/delivery/{id}GETfindDeliveryById(id)CountryServiceDelivery
/discountcampaigncustomergroup/discountcampaign/{id}GETfindAllDiscountCampaignCustomerGroupOfDiscountCampaign(id)DiscountCampaignServiceDiscountCampaign DiscountCampaignCustomerGroup
/productGETfindAllProduct()ProductServiceProduct
/shopowner/shoplicense/{id}GETfindAllShopOwnerOfShopLicense(id)ShopLicenseServiceShopLicense ShopOwner
/shopownerPOSTinsertShopOwner(shopowner)ShopLicenseServiceShopOwner
/salestaxGETfindAllSalesTax()ProductServiceSalesTax
/customerorder/{id}DELETEdeleteCustomerOrderById(id)CountryServiceCustomerOrder
/productpriceGETfindAllProductPrice()ProductServiceProductPrice
/shoplicenseGETfindAllShopLicense()ShopLicenseServiceShopLicense
/shopcustomerGETfindAllShopCustomer()CountryServiceShopCustomer
/discountcampaignproductcategory/productcategory/{id}GETfindAllDiscountCampaignProductCategoryOfProductCategory(id)DiscountCampaignServiceProductCategory DiscountCampaignProductCategory
/discountcampaignproductPOSTinsertDiscountCampaignProduct(discountcampaignproduct)DiscountCampaignServiceDiscountCampaignProduct
/orderitemPOSTinsertOrderItem(orderitem)ProductServiceOrderItem
/customergroupmember/shopcustomer/{id}GETfindAllCustomerGroupMemberOfShopCustomer(id)CountryServiceShopCustomer CustomerGroupMember
/discountcampaignproduct/{id}DELETEdeleteDiscountCampaignProductById(id)DiscountCampaignServiceDiscountCampaignProduct
/customergroup/{id}PUTupdateCustomerGroupById(customergroup)CountryServiceCustomerGroup
/orderitem/{id}PUTupdateOrderItemById(orderitem)ProductServiceOrderItem
/discountcampaignproductcategory/discountcampaign/{id}GETfindAllDiscountCampaignProductCategoryOfDiscountCampaign(id)DiscountCampaignServiceDiscountCampaign DiscountCampaignProductCategory
/customergroupmember/{id}DELETEdeleteCustomerGroupMemberById(id)CountryServiceCustomerGroupMember
/delivery/{id}DELETEdeleteDeliveryById(id)CountryServiceDelivery
/customergroup/{id}GETfindCustomerGroupById(id)CountryServiceCustomerGroup
/product/productcategory/{id}GETfindAllProductOfProductCategory(id)ProductServiceProductCategory Product
/warehouse/{id}DELETEdeleteWarehouseById(id)CountryServiceWarehouse
/purchaserule/warehouse/{id}GETfindAllPurchaseRuleOfWarehouse(id)ProductServiceWarehouse PurchaseRule
/product/{id}GETfindProductById(id)ProductServiceProduct
/shopcustomer/country/{id}GETfindAllShopCustomerOfCountry(id)CountryServiceCountry ShopCustomer





Table of content