Back to case studies

Peer-to-Peer Lending Marketplace for Retail Finance image

Finance service: 2 full stack developers

Lender service: 4 full stack developers


Finance service: 12 months

Lender service: 6 months


Finance: Java 8, Spring MVC, Spring Security, Hibernate, Spring Scheduler, JSP, AJAX, MySQL, Dynamic Reports, Jenkins.

Lender: Java 8, Spring Boot, Spring Security, Spring Data, MySQL, AngularJS, Dynamic Reports, Apache Camel.

Peer-to-Peer Lending Marketplace for Retail Finance

Our client is a London based startup operating in the consumer finance sector. It is a platform for merchants, lenders, and intermediaries, where customers can spread the cost of any purchase over several months while the merchant gets paid in full right away. The company isn’t providing financing themselves but instead connects to its own marketplace of lenders who compete to offer the most suitable credit.

The company works with financial institutions such as Barclays, WorldPay and Klarna. The platform works on any device (phone, tablet, computer), anywhere (in-person/in-store, online, by phone) as the process is completely paperless and instant. The modular structure allows it to be adopted on a country level (language, currency, local regulations, etc) and supports all types of finance ( POS retail finance, SME loans, car finance, payday lending, etc).

Our engagement

Our team worked on two services for the client. The first service we provided is a financial platform that accumulates information about all of the merchants cooperating with the client. It displays all of the transactions of every shop, creates the paycheck for the bank, and forms an archive. Moreover, the platform forms statistics and calculates taxes for every operation. Also, this service is responsible for problem-solving and partially has the functionality of CRM.

The second service is related to lending, where lenders can settle conditions for lending. After that, all applications, which come from buyers, are filtered in accordance with the established conditions. In short, it's a platform that allows lenders to process queries.

Our goal

To provide merchants with an instant point of sale finance solution that works in-store, online, via mobile and over the phone.

The challenges

  1. The first challenge that our team encountered was due to a large stream of query inputs(webhook) in the context of processing DB-connections and in the context of transactions. We had to increase maximum bandwidth in order to quickly proceed with requests per second. Moreover, we had to organize transaction and rollback actions to avoid deadlocks and other similar issues (data corruption, etc.) that may occur during high request rates.
  2. The next challenge that occurred was the loading speed page at a large data volume. The page was loaded in about 30 seconds, which was too slow for us.
  3. We had a problem with effective multithreading. There was a large number of functions (jobs) that occurred simultaneously and intersected. So, our task was to make sure there are no conflicts between them in order to keep the data consistent and avoid having one function-blocking another.
  4. A small problem also arose with cash transactions. The calculations should be accurate and take into account all the marks after the comma. 

The Solution

  1. We organized precise transaction management and set up a correctly configured connection pool.
  2. To speed up the loading time we assimilated SQL queries, extracting the necessary data for a particular page. In addition, we transferred many aggregation operations to the database level. Also, a part of the resources was located in RAM. We had to abandon a static page load in favour of a dynamic one. All these steps allowed us to reduce the page load time down to less than a second
  3. To overcome the problem with effective multithreading we applied spring scheduler and native tools like ScheduledExecutorService, as well as proper transaction management.
  4. To deliver greater accuracy for the cash transactions we used specific classes that provided more accurate calculations. Also, we applied proper error handling, therefore, in case of system problems, money will not be sent anywhere.

The top three features are:

  • Dynamic credit check at the British credit bureau
  • Automated partner payment (stripe), which contains the process of creating checks and sending them to their respective partner shops for payment and creating the archives of every payment
  • Rapid statistics calculations for large amounts of data.