A method, system, and computer program product for decomposing monolithic applications to form microservices are provided. The method identifies a set of classes within a monolithic application. A set of horizontal clusters are generated by performing horizontal clustering to the set of classes to decompose the classes based on a first functionality type. The method generates a set of vertical clusters by performing vertical clustering to the set of classes to decompose the classes based on a second functionality type. A subset of classes occurring in a common horizontal cluster and vertical cluster are identified as a functional unit. The method merges one or more functional units to form a microservice.