Microservice: case study on Smartwcm application

The Smartwcm application is a Web Content Management platform that implements microservice design principles using Spring Boot. The application has several core modules built as self-contained microservices, each with a unique database. The microservices are highly scalable and reliable, and they interact via a gateway that identifies request URL patterns and connects them to the corresponding microservices. The architecture of Smartwcm is a prime example of a well-implemented microservice design that achieves stability and security.

Smartwcm architecture

Microservices in Smartwcm Application

There are four main modules in the Smartwcm application: Web Content Management System, User Management, Customer Relationship Management, and Payment.

Web Content Management System (WCMS)

The web content management module is responsible for all web content-related functions and has a microservice layer to implement the REST API.

User Management

All the user information-related operations are managed in the user management module. Users can update their profile information from the user management module. The administrator has the option to manage the user roles from here.

Customer Relationship Management (CRM)

The customer relationship management module handles all communication for a company, including email, SMS, and phone calls. It has a microservice layer to provide API access to all the features related to customer relationship management.

Payment

The payment module is designed to handle the subscriptions. All the subscription-related functions are done in the payment module. The admin users can create different subscriptions and create plans. Normal users can subscribe to different plans from the payment module.

Steps in handling a request

  • Once the user tries to access the domain wcms.smartwcm.com, the request will be forwarded to the Amazon Elastic Load Balancer and connected to the available server.
  • If the user requests a page that requires authentication, they are forwarded to Single Sign-On (SSO) using Keycloak. Once authenticated, the user has access to all the sites under Smartwcm for a specific period.
  • If any of the layers require API data, the request will be forwarded to the gateway, which identifies the request URL pattern and connects it to the corresponding microservice. Each microservice connects to the database through the Object Relational Mapping (ORM) tool, Hibernate, which supports database-independent queries and caching. As shown in the diagram, each microservice has a connection to the database, which in this case is the Amazon Relational Database (Amazon RDS). The database is accessed through the (Object Relational Mapping) ORM tool. Smartwcm uses Hibernate as the ORM tool since it can handle database-independent queries and supports caching.
  • Smartwcm stores all media files, such as PDFs, Word documents, images, etc., in S3/CloudFront. Amazon S3 is a highly secure, scalable, and durable object storage service that Amazon Web Services (AWS) provides. S3 lets users store and retrieve data from anywhere on the web. On the other hand, CloudFront is a content delivery network (CDN) provided by AWS that can deliver content to users with low latency.
    Along with the above-mentioned steps in handling a request, Smartwcm uses many external services to implement different features in the application. Vimeo, Stripe, Twilio, Stripe, etc., are some of the services. These services are used inside the microservices to enable some functionality.

Other Services used

Ehcache

Cache memory is used to increase the data access speed. The frequently used data can be transferred to the cache memory. Ehcache ( EE-aytch-kash) is an open-source Java distributed cache for general-purpose caching, Java EE, and lightweight containers. Ehcache is available under an Apache open-source license.

Jackson

JSON stands for JavaScript Object Notation. It is designed to exchange data between applications. It is a text format that is easy to read and write. It is a language-independent data format. JSON supports almost every kind of language, framework, and library.

Jersey Client

Jersey Client is a high-level Java-based API that provides a simple and suitable way to interact with RESTful web services. It allows developers to create HTTP requests and handle responses easily without having to deal with low-level details such as network connections, I/O streams, and message parsing. Jersey client is part of the Jersey framework, which is a reference implementation of the JAX-RS API for building RESTful web services in Java.

Solr

Apache Solr is a search platform built on top of Lucene. Apache SolrJ is a Java-based client for Solr that provides interfaces for maintaining search features, like indexing, querying, and deleting documents.

Amazon SES

Amazon Simple Email Service (SES) is an email service provided by AWS. SES enables email services through SMTP. There are built-in notifications for successful and unsuccessful email deliveries and complaints. Amazon SES has the options to send bounce-back and complaint messages by email or through Amazon Simple Notification Service. Amazon SES offers a mailbox simulator to test how the application will handle different possible email-sending situations, like a hard bounce, an out-of-office auto-response, a complaint, or a successful email acceptance.

S3 Storage

Amazon Simple Storage Service (Amazon S3) is an object storage service provided by Amazon. Customers can store any amount of data in S3, and data will be secured. There is an option to give extra security to the data. All the static media files are saved in S3 in the case of Smartwcm.

Amazon CloudFront

Amazon CloudFront is a web service that speeds up static and dynamic web content distribution, such as .css, .js, .html, and image files. CloudFront delivers the content through edge locations. Edge locations are the worldwide network of data centers. When a user requests content served with CloudFront, the request will be initially routed to the edge location with the lowest latency. CloudFront delivers the content instantly if it is in the edge location. If the content is not in the edge location, in that scenario, CloudFront retrieves the content from an origin you've defined.

Stripe

Stripe is a platform to process payments over the Internet. Stripe has its own client-side libraries. Stripe's software allows businesses to accept payments online and provides tools for managing payments, subscriptions, and billing. Stripe's platform is used by businesses of all sizes, from small startups to large enterprises. Smartwcm uses stripe APIs to handle the payments.

Vimeo

Vimeo is a video hosting and sharing medium. Vimeo allows users to upload, share, and view videos and engage with other creators through comments, likes, and follows. Vimeo services are used in Smartwcm to present videos.

Post a comment