Shiksha Tech Stack Migration

Shiksha Engineering
4 min readDec 12, 2019

--

Author : Romil Goel

Shiksha Tech Stack Migration: From PHP/Apache to React/NodeJs + Java Microservices

At high level, this blog will explain why we moved from PHP/Apache Monolithic System to SPA and Microservices based architecture. Monolithic design tends to amplify and enable coupling which leads to scalability issues, dependent deployment, team-code ownership issues and more.

Many developers agree that an agile development process which is organized into sprints is the best way to have a product that is improved iteratively based on user feedback. Wasting future resources by creating “Code Debt” undermines the agile development process by potentially causing weeks or months of work to be spent on rewriting deprecated sections of code.

We starting with overhauling our Architecture by Replacing PHP/Apache with :

  1. Frontend : ReactJS/NodeJS
  2. Backend : Microservices/Java

The methodology we used to rejig our architecture was iterative one i.e. pick one module or flow at a time, develop it in sprints and then finally replace the old codebase with the new one.

One thing at a time rule
Image Source : shinethroughyou.com

Opportunity to Improve

One immediate opportunity that came before us was providing a better user experience to our mobile users. The solution was to adopt Progressive Web Apps (PWA) for better experience on mobile devices. The primary case at hand was to offer a robust network connection for offline usage and on slow-network connections to our rapidly expanding mobile phone user base. Besides, we also wanted to offer an app-like experience to these users for better engagement. We came across the PWA and we decided that this is the way forward for us to provide app-like experience to mobilesite/desktop users. PWA itself is a difference universe to explore and explain which can be explored here

Reasons to Opt ReactJS for Frontend Development

  1. Faster Development with Reusable Components
  2. Build Reactive Apps with Virtual DOM
  3. Simplify Coding with Declarative Programming
  4. Build Creative UI using Javascript
  5. Easy Integration of ReactJS in Existing Code
  6. Strong Community for Support during Development
% of developers who are developing with the language or technology and have expressed interest in continuing to develop with
Image Source : insights.stackoverflow.com

The major factors considered while comparing include Development Speed and Productivity, Popularity, etc.

Based on its strong community support, roots in conventional javascript and lightweight framework, we opted for ReactJs as our front end framework.

Why Monoliths are Bad Design ?

Generally, if you have a relatively simple web application it handles just a few processes. It will handle your HTTP requests and perform some internal logic. It might query and update the database and serve up HTTP templates to the client-side. If you’re still learning how these various items are handled, it might make sense to store all of your code in one codebase, or to house them in a single repository even if they are separated into multiple files.

A main problem of monolithic architecture is “Code Debt”. As Wikipedia defines it “Code debt is a concept in software development that reflects the implied cost of additional rework caused by choosing an easy (limited) solution now instead of using a better approach that would take longer.”. Code debt can be compared to monetary debt. If technical debt is not repaid, it can accumulate ‘interest’, making it harder to implement changes later on. You’ll end up paying later on with long refactors and code reworks when your product scales or your stack changes.

Another reason is that a problem in one area of the application can cause ripple effects and even downtime for the entire website.

Advantages of ‘Monolith to Microservices architecture’ :

  • Fault Tolerance : Loosely Coupled .One service wont bring the whole system down .
  • Granular Scalability : Scale only parts that require more resources.
  • Rapid Deployments : Independently Deployable / Lower cognitive load .
  • Development Scaling : New developers find hard to work autonomously on a giant, monolithic, tightly coupled code base .
  • Focused Team Organisation : Organized around business/domain capabilities (DDD) .
  • Flexible Tech Stack : Ability to choose right stack according to problem statement + Easier to modernize tech stack in future.
  • Lower Latencies : Ability to cache BE services output helps reduce latency as well as provides ability to serve more traffic with similar hardware.

What have we achieved

  1. Separation of Concerns
  2. Independent Scaling : Only microservices/database of concerned modules needs to be scaled.
  3. Smaller and faster deployments
  4. Improved fault isolation: Larger applications can remain mostly unaffected by the failure of a single module.
  5. Provide app-like experience with PWA + Microservices.
  6. Moving away from Legacy Code(Biggest pain for a developer ;) )
  7. Improved Google Page Insights Scores.

Challenges Faced

  1. Adapting New Technology comes with its Learning Curve.
  2. Setting standards for newly adaptive technology in terms of coding practices, DOs, DONTs.
  3. Debugging and error fixing improved over-time with experience.

Conclusion

To sum it up, it was an experience full of learning and exploring which rarely happens in lifetime of a web-product as it was completely a language & architectural shift.

Also Read

  1. Shiksha Front End Stack Migration
  2. Shiksha Backend Stack Migration

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response