Bisa AI and Tampil.id: Python backends, from registration to an AI model
Overview
At Bisa AI (Jun 2019 – Mar 2021) I worked on Python backends for two products: bisa.ai, an Indonesian technology learning platform, and tampil.id, an online conference platform. The work included integrating an AI model into the system. The stack was Python with Flask and MySQL.
What I built
The bisa.ai backend. My part covered student registration, creating course syllabi, integrating with the conference server, integrating an AI model, and a payment gateway. The details of the payment integration stay out of this write-up on purpose.
An AI model for lung scans. The platform included a model that detects COVID-19 from lung scans. The model had already been trained, so I did not train it: my part was integrating it into the system, in Python with Flask, so the rest of the platform could use it.
The tampil.id backend. As far as I remember, my part covered login, registration, and the integration with the conference.
Smaller parts. Two smaller parts of my time there: when the front end had an integration problem its own side could not resolve, I handled that part temporarily with CodeIgniter (PHP), and I also gave a webinar for Bisa AI.
What was hard
Python is not the best language for every backend workload, and I ran into many performance problems along the way. One strong reason was how the code handled database connections: there was no shared connection like in a Go service. Every time the code needed the database it called a connect function, so an endpoint that made ten database calls opened ten connections.
After working at Olsera I know one way to fix this: open the connection once at startup and reuse it through a connection pool, the way *gorm.DB does in Go.
Another problem I found was that the code did not use database transactions. Without a transaction a multi-step change cannot be rolled back when one step fails, so we had to make very sure that no step could go wrong. I only properly understood database transactions after working at Olsera.
Result
Both bisa.ai and tampil.id were delivered and ran in production. It was a long time ago, so I only describe what I clearly remember here.
Public products
Stack
Python, Flask, MySQL.