We are coding, Crop is growing. Engineering@Fasal

Ananda Prakash Verma
Fasal Engineering
Published in
7 min readJul 27, 2018

I am an engineer at heart. I think and I code and more importantly, I make a lot of trade-off decisions. Fasal is a 6-member team today, and though we are doing multiple jobs, 6 out of 6 are engineers first and we are proud of it.

Our team and even our investors can see the sparkle on my face when I talk about engineering. Our co-founder Shailendra would definitely agree with this. Because I see him sparkle when he talks about building a product. Both of us now talk more about investment, strategy, and core business components but deep down we both love to engineer and build the product.

Fasal in all sense has a very strong foundation, be it a product foundation or technological foundation. I am here to talk more about technical stuff.

When we started Fasal, we had a few things in our minds that we wanted to achieve —

  1. A small and high-performance team
  2. Self-driven and motivated team
  3. De-coupled and Cohesive system design
  4. Single codebase for all platforms
  5. We can be DevOps
  6. We can be QA
  7. Zero downtime, rolling upgrade, and auto-scale
  8. No one wants to wait for the next app release, so hot code push for apps but no crashes, please!
  9. Self-log, self-monitor, self-heal
  10. Peace of mind

Before going deep into each point mentioned above, let me discuss a few various systems at Fasal. Core to its technology Fasal is an IoT and AI platform. We have -

  • A sensor node that connects with an array of sensors records data at every configured interval, creates a data frame, and pushes it to the Fasal backend server on a 4G/3G/GPRS network. The node is solar-powered, supports deep sleep mode, and can be programmed over the air (OTA).
  • A linearly scalable container-based IoT backend server is always available. Processes the data frame and stores it on Fasal's highly available and replicated storage servers.
  • An app backend and frontend. A single codebase for web-app and all mobile apps. The app backend talks to the Fasal storage server to pull data and run algorithms. The app frontend presents data to users on the Web, iOS, and Android.
  • AI engine periodically loads data from n different sources, trains the ML algorithms, deploys the model, and gives an endpoint for prediction.

The interesting bit is — all the above is developed and managed by 2 and a half engineers at Fasal and you will hardly see us working on weekends. I am the half engineer here :).

We always want to remain a small and high-performance team. And saying that doesn’t mean that we want to work late in the night or call engineers at midnight to troubleshoot customer issues. We strictly want to balance work-life. We have actually achieved that and we will keep following that practice always. Fasal is built in a way that it never goes down or till date, it has not gone down. I will share some stats for this claim.

Our IoT backend server is written in Java using SpringBoot and deployed on AWS Fargate using Containers. Under high load, it auto-scales and balances the incoming traffic in a rolling fashion without losing a single request. If a running instance is about to crash it launches another instance in no time and re-directs all the traffic to the new node. When we deploy a new version, it performs a rolling upgrade by first moving all the traffic to the new version, doing all the checks, and bringing down the old nodes.

The last time we deployed our IoT backend was sometime in Feb 2018. We never looked back or got any midnight alerts. It auto-heals itself whenever needed without bothering us.

Last deployed on 22nd Feb 2018
At times the load is really high
Look Ma! it auto-heals itself

We always want our team members to be self-driven and self-motivated. Our brilliant engineers Dhaval and Shivang work on their own. I and my co-founder are mostly busy talking to investors and partners these days, and hardly get time to sit in the office but that doesn’t stop our engineering pace. Dhaval and Shivang have taken that responsibility they do planning and execution by themselves and we push code daily and make at least 3–4 releases every week.

When you design a system that is de-coupled, you have greater flexibility to make a change in small parts without affecting others but it also opens more chances of bugs, more connection points, and also the management overhead. We at Fasal have taken a strategic step in building all our systems to be de-coupled and highly cohesive but leave fewer open points for issues and management. Our app server is written completely in Node.js and Meteor framework. We have extensively used Meteor DDP for pushing real-time updates to our apps which also makes our app more responsive in nature.

Node.js and Meteor have provided us with a great language and framework combination where a single code base has allowed us to build our web app, iOS, and Android app in a single day without any hassle. We are a fan of containers and our app server is also deployed in containers in the same fashion as our IoT backend server which just takes care of itself without bothering us at all. Again never went down from the time it is life.

As I told you earlier, we do 3–4 releases a week which go to production instantly and also to all our customers without them updating their app. We don’t even publish a new app. We publish the app once a month or even longer. It seems like real magic and the best part of our deployment process. It’s called hot code push. Another brilliant feature by Meteor allows you to push new code to all the apps in a blink without the end-user noticing it. And you may ask why we do that and why it is extremely important for us? Because we deal with the customer (farmers) located in remote places with slow internet connectivity. We want to deliver new features but updating the app every time is not gonna work. So we decided to do a hot code push. Happy customers!

193 releases in the last 6 months

Managing web apps, Android and iOS looks very challenging. You have to take care of versioning, devices, and crashes. Fortunately, Fasal has not crashed yet, not on a single device in the last 6 months. I am very proud of that. And we don’t want to crash ever. That’s a big commitment but we are all in to make sure it doesn’t happen.

Jan 1st, 2018 to July 27th, 2018. No Crashes!
No ANRs or Crashes in the last 60 days

Crop is growing, We are coding

That is all we have done in the last 6 months. Two and a half engineers and an awesome team. We are also committed to giving back to Open Source and you can see some of our current work under our Git Repo. This is just a start. There are many more things we want to open source and we will do it as we move forward and with the commitment to manage it always.

Our recent contribution includes a Mongo-backed API rate limiter which Dhaval has been working on for some time now. It was a demanding feature request from many in the community. He has finally filed a PR yesterday and it is life now. We have used it in Fasal and it works really well.

Another upcoming PR is from Shivang. He has modified Cordova to support actions in the mobile notification. We will be pushing it very soon. He is still documenting it.

We are also opening our APIs. Right now for internal partners who are building excellent service for farmers. We have already opened a few and that is where Dhaval has created a Mongo-backed API rate limiter on express.

From the first day, we had decided to be a software company, focused on AI and predictions. But hardware is an integral part of our solution and most of our competitors are building really cool IoT devices for agriculture. We see them as our collaborators in the future. But to adhere to the market demand we have also started assembling and building our own hardware. Our sole aim is to make hardware a commodity so a larger farming community can be benefitted from the Fasal solution.

We are very soon publishing our first research paper on Micro-Climate prediction. I am trying to buy some time from my regular work to focus on writing it. We are also hiring active AI engineers and Plant pathologists. Do send your CV to connect@wolkus.com.

Fasal Team. Sorry Saurabh, you are missing.

I am more active on Twitter — https://twitter.com/anandaverma20

--

--