Everybody who builds software are aware of modular architecture and API. But many are unaware of the absolute importance of modularity and api. I will introduce the concept with one of the recent projects that we implemented and it had to do with Cloud migration from Amazon to Hosting.com which also included database migration from MySQL to SQLServer. Here below is the description of migration:
Migration from Amazon Web Services and MySQL to Hosting.com and MS SQL
In the late stage of development a decision was made to migrate from Amazon Web Services and MySQL to Hosting.com and Microsoft SQL Server respectively. Due to modular structure of application, only modules that were tightly coupled with Amazon-specific features, like virtual files repository module that used S3 buckets to store localization files and other files, or logging module that used Dynamo DB service to store logging output separately from application data and content had to be changed.
Because of Entity Framework being used as foundation for Data access layer, the data layer was kept almost unchanged during migration from MySQL to MS SQL Server. Just few optimized queries that were made directly to database for reason of better performance for reports generation, and easier implementation of queries, were rewritten to follow SQL Sever syntax. Other changes related to this migration were update of application configuration files.
A modular architecture designed by Moogilu’s team helped with migration. And migration with testing and release was done within 3 weeks.
As can be seen from above the data layer was abstracted and made the migration easy. Without this abstraction, it would have been impossible to migrate the application in such a short time.
A product is architected as modules which do a particular functionality. The decomposition of a product into modules comes with experience and understanding of the product needs. Once this is done, the API follow. The API will help any other application or module to invoke the functionality with well defined inputs/outputs. And in the web architecture they are essentially REST API or Web Services.
If the modules have canonical APIs, it becomes easy to make the architecture work. The combination of API and modules defines a good architecture. With the API, it is easy to do the following:
- Test the product with API
- Build other applications including mobile application with the API – producer-consumer model
- Migrate the modules/application to any infrastructure
- Performance scaling of the modules/application
- Instrument the application/modules using API for monitoring
A well-defined modular architecture with API definition is foundational to building highly scalable and flexible applications. And more important, it becomes easy to test, host, and maintain the applications.