Life for online grocery store Grofers has been a bit of a rollercoaster since its inception in 2013. In this short period of five years, the business of selling groceries online in India has seen a boom, a bust and now a revival that appears to be sustainable.

Less than two years after its launch, Grofers found itself in the midst of immense competition. From Sequoia Capital-backed PepperTap to Flipkart Group’s Nearbuy, everyone wanted a piece of the online grocery business pie, and more than 300 such firms had cropped up. Yet, despite investors with deep pockets, most of the start-ups in the space shut down. BigBasket and Grofers were one of the few to remain.

Soon, it was evident that a hyperlocal sourcing model to service customer orders would simply not work. Instead, what would work is setting up warehouses and servicing orders from the inventory in the warehouses.

Grofers, that had already raised $155 million by the end of 2015, realised this the hard way. After expanding rapidly, in early 2016, Grofers had to scale back and shut down operations in nine cities.

But to their credit, the learnings were rapid. By the middle of 2016, Grofers had completely stopped the hyperlocal delivery model. “We moved out of the hyperlocal delivery business 18 months ago. All our deliveries are sourced from our warehouses now,” Albinder Dhindsa, co-founder and chief executive officer, Grofers told Fortune India.

The change in the business model appears to have worked as Grofers has successfully managed to regain the faith of its investors. Last week, SoftBank Group led a funding round of $62 million (about Rs 400 crore) in Grofers, the company’s first fund infusion since the storm of 2015.

Dhindsa is confident that the warehouse model will be successful in other cities. “Delhi is breakeven for us. For other cities also we need to use the same model,” he says.

He admits that there would be challenges in scaling up in order to catch up with players like BigBasket, who raised $300 million in its Series E funding round led by Chinese Internet giant Alibaba Group.

“Our supply chain is stretched in most places. For example in Delhi, last Saturday we did 24,000 orders. But in the next six months, we are expecting Delhi will touch 40,000 orders. To deliver those, we need to set up more warehousing facilities,” says Dhindsa.

Currently, Grofers has 23 warehouses in 13 cities. According to Dhindsa, the company plans to open larger warehouses in the cities they operate in rather than expand out of control. For example, in Gurugram, Grofers recently opened a 100,000 sq ft facility.

The fresh funding will be utilised in two focus areas, says Dhindsa. “We will continue to invest in the supply chain side. What we have done in the last year and half is build up our supply chain through which we deliver goods with a high level of accuracy to the customer,” he says.

The second area of investment will be technology both on the supply side and the consumer side of the business. “We are the only player with the entire tech team in house. That has helped us be more efficient. The way we see it, to become profitable, we have to keep increasing our efficiency and technology is a big part of that,” says Dhindsa.

When it comes to business models though, Dhindsa wants to keep building on what Grofers has been doing so far and does not want to upset the apple cart. Asked whether offline stores would be an option, an idea that many mature e-commerce companies are flirting with, Dhindsa said, “We did those experiments in 2016. Our view is that these are two separate businesses and we will stick to online only because through this we get a lot of efficiencies.”

Such clear focus is sure to come in handy at a time when competition is rising, not just in terms of number of players in the business but investments being poured into a few competitors that continue to try to crack the online grocery business puzzle.

While BigBasket has the Alibaba Group’s backing, American giant Amazon is equally aggressive about its own grocery delivery platform Amazon Now by regularly offering more services and more products. With rumours that Walmart is planning to buy a majority stake in Flipkart, it is only safe to assume that competition in the space will only grow. The most obvious reason for the interest is India’s demographic. According to a Morgan Stanely report, there are more than 400 million millennials — those born after 1982 — in India. And these people will buy grocery more regularly than mobiles or fashion according to Dhindsa. “We buy groceries every week but you don't buy a cell phone, infact, even every month,” he said.

Luckily, the market also appears to be at an inflection point. According to RedSeer Consulting, the online grocery market is ‘on the cusp of an extended growth cycle’ and can potentially reach $2-3 billion by 2020 driven by developments both on the supply side and demand side. “On the supply side, players are offering multiple business models (express delivery vs slotted delivery, on-demand vs subscription based models) and continuously growing the ease of shopping (driven by large selection and convenience of app-based shopping). On the demand side , growing awareness and comfort with online grocery shopping are likely to drive growth by roughly 50% year-on-year over 2016-2020,” a recent report from the firm stated. The fact that online purchases account for only 0.2% of India’s total FMCG and grocery sales means that the market will be big enough for everyone from BigBasket, Grofers, to Amazon and others to co-exist.

Dhindsa, says that the start-up has a head start over other players in the grocery segment giving it an edge as the company has had a front row seat to the transformation of the industry. In SoftBank, the company has an investor that believes that 'India is never likely to have a scaled organised retail in the form of physical department stores but will gravitate towards mobile e-commerce'.

From a loss of Rs 225 crore in the financial year 2015-16 on revenues of Rs 8 crore, the company claims that it would cross Rs 1,000 crore in revenues in 2017, according to media reports. Dhindsa did not share specific revenue numbers with Fortune India but said that they have achieved a four-fold growth in business over the last one year. With a new round of funding after a gap of over 2 years, it remains to be seen how the company charts its route in the online grocery market and navigates through the tides of increasing competition.

Follow us on Facebook, Twitter, YouTube & Instagram to never miss an update from Fortune India. To buy a copy, visit Amazon.