RedditLoans

Summary

This website supplements the /r/borrow community, which facilitates peer-to-peer loans between Reddit users. Only users with a minimum level of cumulative karma and account age are eligible to join the community. Those seeking loans post publicly on the subreddit and those willing to fulfill loans respond. The two negotiate privately, and if an agreement is reached the principal is shared publicly via a carefully formatted comment on the thread.

Later, when the borrower repays partially or completely, that is then also shared publicly via another carefully formatted comment. Note that interest is never publicly disclosed. If the borrower does not repay within time, the lender may disclose that as well, again via a comment. This LoansBot detects these comments and indexes them for searching. It also adds a variety of administrative tools to help maintain a healthy community.

Open Source

The LoansBot has always been open-source, and has always consisted of at least two custom parts - a service for monitoring the subreddit and a service for serving the website. The subreddit monitoring part is generally referred to as the LoansBot as it contains most of the business logic, whereas the site is referred to as the LoansBot Site.

In the first and second iterations of the source code powering the LoansBot and the LoansBot Site, the LoansBot was written in Java and the LoansBot Site was written in PHP. Everything ran on a single server, including the MySQL database containing all of tracked and indexed loans. The first iteration powered the bot from early 2013 through late 2014, and the second iteration (LoansBot, Site) through late 2020.

The third iteration of the website transitioned to a multi-server architecture to handle the steadily increasing load and corresponding increases to funding and business logic complexity. The collection of repositories is available under the GitHub organization LoansBot. It is powered by Python for both the LoansBot and the LoansBot Site, and uses PostgreSQL as the database.

Stable

The LoansBot has been around since 2013 with continuous community support and engagement. Although there have been periods of only maintenance, during those times the LoansBot infrastructure continued to be monitored and support was rapidly available. The LoansBot has backed the database up regularly since 2014 and currently stores backups for 372 days.

The LoansBot runs on an extremely robust infrastructure which is likely to be around 10 years from now and can scale to meet our needs, both upward and downward:

The LoansBot is wary of the bleeding edge but has evolved as industry standards change. For example, with the advent of log structured key value stores, notably RocksDB, a solution for efficiently using disk space has started to be incorporated into the community. The LoansBot uses ArangoDB as its interface into this underlying algorithm. Log-structured engines are particularly well-suited for pure key-value stores in memory-starved contexts, filling a niche not served by traditional databases or caches, and hence that is precisely what the LoansBot uses it for.

For completeness sake, these are the critical dependencies for the Site, excluding those already listed:

Note that NodeJS and build tools like webpack are not part of this list. The NodeJS community has a track record of constant breaking changes and absurdly slow build times. These things can easily kill an open-source project. Instead, a particular version of React is referenced from a CDN. The entire frontend requires no preprocessing and is served statically.

Mobile Friendly

This website uses an aggressively simple design which is naturally friendly to small screens and mobile devices. This simplicity also means that this website is friendly to keyboard-only users and every form of color-blindness. No ads, no third-party tracking, and ubiquitous cache-control headers save battery life and bandwidth.