At the Right Time and for the Right Thing
- JSON output from server-side could be used for multiple “front ends” - Web, Mobile, Embedded.
- The open API was helpful to build up a platform and be recognized as leading data provider.
- JavsScript could provide a much better user interaction on the front end.
- It was the hipster tech stack at the time
Well, to be honest, the last reason, which was probably the worst reason, was actually what dominated my decision. The others was simply what I used to reinforce myself. So here is how it went.
One API Cannot Rule Them All
When we introduced our mobile app, which was six months later, we found out that we simply could not use the same API. The API that powered the website returned the data tailed for website - which was very different from what mobile needed. Using the same API only utilize about ten percent of the data returned on mobile, which was a waste of bandwidth. We ended up have to build a separate API for mobile only.
Nobody Believes in Our Platform
As a startup, it’s very very very difficult to sell yourself as a platform, especially when your customer is more established than you. So when we were trying to sell our data to those tech new websites, nobody bought it. Some were willing to try it but soon gave up as they could not see any short-term benefit. A platform was not intended for short-term, you needed to give it some time. But rarely anyone would give a startup “some time”. So no one ended up using our open API.
Our Site Does Not Need Interaction
For most of the time, our visitor only read on our website. Occasionally they posted some comments, “liked” some startups and that was it. There was no “heavy” user interaction at all. Even if we did not have AJAX at all, users would not mind.
I completely re-wrote the website after 8 months, and went with traditional server-side rendering. The most important reason is: we could not get SEO right. SEO is always a nightmare for AJAX. Most of the web app, which lives behind the login wall, does not really care about SEO, but we do. One of our most important traffic source was from search engine. As startups got publicity in tech news all the time, lots of people searched for them. And most of the non-web startups (e.g. mobile app, hardware, etc) does not have a website or does not do SEO at all. Therefore our website was usually the top 3 result. Google had some spider rule for crawling AJAX, which required some setup. However, the search engine giant in China, Baidu, did not crawl AJAX at all.
Expensive to Maintain