Your database can be a single variable in memory 0 ▲ Guilherme Souza 2 hours ago · 8 min read1693 words · Tech · hide · 0 comments Well... There are trade-offs, but don't trash the idea just yet :) Be assured that nobody is coming to take your beloved MongoDB, Postgres or other database away. They are marvellous piece of software that solve complex problems quite well. However, in this post I invite you to think what do you need them for, which problems they solve for your apps and, crucially, which problems they create on their own. I got tangled in these questions while developing nidimages, a self-hosted app to share photos with family and friends. So I decided to write a synthetic load test to compare from different perspectives Postgres and a file-backed variable. A file-backed variable That's a fancy name for a rather dangerously-simple concept: you parse a file on startup, then you rewrite the file from time to time. Let's implement the gist of it in Python: def main(): database = json.loads(Path('data.json').read_text()) def save_loop(): while True: sleep(10)… No comments yet. Log in to reply on the Fediverse. Comments will appear here.