Rakuten Ichiba : Our journey towards Best E-Commerce App

f:id:R-Hack:20211119104717j:plain

My name Yusuf and I am an Android engineer working in Japan Ichiba App team which belongs to Commerce TECH. Our team works on bringing the best user experience as well integrating Rakuten services along with adapting to latest technologies.

Brief Introduction:

As a tech e-commerce giant with the tagline Shopping is Entertainment, our goal is to provide a seamless experience to our customers.  

Since our launch in 2011, Rakuten Ichiba is one of the top and popular E-commerce App with more than 10 million downloads and 4.2 rating on Play Store (As of Nov 2021).

Long story short, we can say Ichiba App has the same evolutions as Android.

  • From Eclipse to Android Studio
  • Java to Koltin and now Jetpack.

Even for architectures and Frameworks

  • MVP to MVVM.
  • Listview to recyclerview
  • findviewbyId to data-binding
  • AsyncTask to Rx to Coroutines.
  • GoogleAutoFactory to Dagger

Like our project our team is also comprise of multiple nationalities, from countries like Japan, Hong Kong, India, Malawi, and Spain. 

Challenges:

As one of the major players in the e-commerce market in Japan, we must engage and attract customers, by offering new features in regular intervals and keep up with technologies with top quality. It’s a match that is not made in heaven for such a large-scale App and a difficult balance that need to be maintained carefully. Just to give you context, even a small bug can have a business or legal impact.

There are development issues also associated, for instance upgrading one library might make the project uncompilable or a single line change have a project-wide impact, or sometimes it’s not possible to modernize, it can be due to various reasons.

Rakuten has lots of services under its hood. With high user base our solution need to be precise because it will have impact on other products or services.

Our Approach:

We firmly believe in this statement.

“Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” ― Martin Fowler

In 2018 Ichiba app was having partial MVP architecture and most of the code was in Java. Due to continuous development, our app architecture was not SOLID. It resulted in more development time, risky code changes due to tightly coupled code, difficulty in writing unit test case and complicated dagger graph. We realized it’s time for us to revamp the app as per Android Standards. First, was an obvious one, wanted to migrate to Kotlin. To be honest, we all fell in love with the language. We drew up app guidelines for usage of Kotlin language and set a rule “any new feature would be written in Kotlin.”

Second one was a big one changing the architecture of the app. At that time most popular architecture was MVVM and we choose that. Simple right?, if it would been that simple it wouldn’t be ichiba.

Few things we learned during our quest for new architecture:

  • We cannot stop our current feature development
  • We cannot reuse the existing code
  • Complete app cannot have one architecture
  • Network and Caching layer needs to be updated.

Our quest continued, the process to find the appropriate architecture was

  1. Achieving SOLID
  2. Making business logic testable
  3. Ease in maintenance  
  4. Learning curve should be less.

We created POC of all famous architecture at that time like Redux, MVVM, and MVI. After performing the SWOT, we opted for MVVM.

In this expedition, we replaced to

  • Volley to Retrofit
  • Volley to Glide
  • New Logger with Timber
  • DataBinding

If you remember before 2020 Ichiba app was not having bottom navigation. It was only possible after the refactoring.

After a pause, we continued our voyage and did refactoring of Search Module with Redux and took advantage of Kotlin DSL for our Network layer migration to BFF. 

f:id:R-Hack:20211119104802p:plain

Fig: MVVM architecture

Learnings:

We have come a long way, and in recent years we had taken some bold decision. Most of them paid off and some of them didn’t, but the experience we gained is invaluable.

Important lessons:

  • Take architectural decisions carefully, it will be with you for a long time.
  • Smartly not blindly adapt to new technologies
  • It’s always binary, never consider anything.
  • Always refer to the past to safeguard the future.

“What is done cannot be undone, but at least one can keep it from happening again.” - Anne Frank

f:id:R-Hack:20211119104756p:plain

Fig: Last 6 years timeline 

Future:

Continuing to adapt MAD (Modern Android Development) tools and APIs.

Currently, working on a big challenge of transforming Ichiba into a module-based App. Allowing to add and remove modules dynamically. For such a big application it will a huge plus as it will give separation of concerns and isolated troubleshooting.

Feasibility on Jetpack compose. Ichiba is a rich UI app with lots of complicated custom views. With Jetpack Compose, it simplifies the app development process, complicated views can be easily developed and with less code and more power.  

f:id:R-Hack:20211119104724j:plain