This series of articles is about me spending way too much time trying to solve a niche problem while learning how to use the AWS Serverless stack (and Kafka, initially).

It’s not supposed to be a tutorial or an exhaustive presentation, but more a story of how I built and hosted a “real” application and the challenges I faced. Hopefully, you will end up with a better understanding of the AWS Serverless stack and what it means to develop with it. Enjoy!

Lockdown and dead stations

Paris, May 2020, end of the first lockdown. I decide to join some of my friends for a picnic. So, like many Parisians, I’m headed toward the Bois de Vincennes, Paris’ largest public park, on the eastern edge of the city.

The weather is perfect for a short bike ride and I quickly rent a Velib, one of the many public bikes that can be rented and returned in any of the 1500 stations scattered across the city. Arriving near the park, I look at the official app to find the nearest station with available slots to return my bike. As I approach, something seems off. I see several people, puzzled, trying to rent or return a bike. I sigh. The station is locked. Dead.

Velib was created in 2007 and quickly proved successful, becoming one of the most used bike sharing platforms in the world. In 2017, after the end of the initial 10 years contract, the city chose a new operator to manage and develop the network. And let’s just say the change was not smooth. Three years later the main problems have been solved but, still, Velib users face two common hurdles: the broken bikes that are not removed from the stations (whoses seats are returned by the disapointed cyclist to kindly warn the next user) and, more rarely, stations that are “locked” for a few hours, without notice on the official app or website.

After finding another station, I join my friends and wash away my misadventure with a cold beer. But I can’t stop thinking about it. It’s not the first time I had to find another station because one was unusable. Why didn’t the official app show the station as dead? Isn’t it easy to detect a station that suddenly stopped renting or returning bikes? How hard could it be with the proper data?

The Velib API

Luckily Velib exposes a public API. The same data can also be found in the Paris OpenData project which incorporates and exposes a lot of public data about Paris (if you ever looked for the dataset of every one of the 200.000 trees in Paris, it’s there!).

#kafka #serverless #dynamodb #aws-lambda

Detecting Locked Bicycle Stations: An AWS Serverless Story (Part 1)
2.30 GEEK