98 percent cloud cost saved by writing our own database