def load(self):
        with self.lock: 
            if not self.cache:
                # Lock concurrent threads when modifying cache.
                for r in self.execute("select * from `rate`;"):
                    self.cache[(r[0], r[1])] = (0, r[2], r[3], _time.time())
                self._rowcount = len(self.cache)
For performance, rate limiting is handled in memory (i.e., RAM).
dataset/ETHPy150Open clips/pattern/pattern/server/__init__.py/RateLimit.load