Skip to main content

Posts

Twelve Factor app development for Microservices

The Twelve (12) Factor app methodology is a list of principles for any Web Application or Software as a Service, and it is especially useful for microservices. This methodology can be applied to apps written in any programming language that use any combination of backing services(database, queue, memory cache, etc). 1. Code Base  - There should a dedicated code base per app. There should be a dedicated code base for each App, and multiple code bases can not use the same code base. If any code base is required by more than one application, separate that code into a separate repository, and inject that using dependency manager into the dependent apps. The same code base can be used to deploy the application to different environments like develop, stage, and production. 2.  Dependencies  - Explicitly declare and isolate dependencies. All the dependencies need to be explicitly declared, and should be available as part of the build process. The should not depend...

Java Comparator Applications

Java Comparator is one of the favourite questions in Java Interviews. This concept looks deceptively simple, and slight variations of this could be asked in the interviews. 1) Write an AlphaNumeric Comparator in Java that sorts the given strings in the human readable     format.  e.g., file1, file2, file 3, file4, file 10 Not like the typical comparator file1, file10 2) Chained Comparator which can be used to join Multiple Comparators 3) Given a List of Employee Objects group the Objects such that all the employees are grouped by     Department and by Name. 4) Use Java 8 Style Comparators