Database Optimizations

API Optimization So far, we’ve built a simple REST API that exposes basic stock ticker resources, including historical data, tickers, and technical indicators such as SMAs. Our database consists of roughly 25 million rows and has a size of around 2GB. Although the database isn’t exceptionally large, the table sizes are significant enough to warrant exploring database optimizations. Let’s examine our current API response times. Response Times Consider the following endpoint:...

July 10, 2024

Setting Up The API

The API In this project series, we’re going to build a REST API that exposes resources related to stocks. In this post, we’re going to precompute our technical SMA indicator for our clients to consume through our API. You may find the code in the following repository: https://git.thecodebranch.com/blog/finance-api/src/tag/setup-api So far, we’ve generated a database with roughly 25 million rows of fake ticker data representing stock data from the years 2000 - 2020....

July 8, 2024

Command Line Parsing

Why Use a Command Line Parser? In the process of developing a project, especially one as dynamic and multifaceted as a financial API, we often find ourselves repeating certain tasks. These tasks might include rebuilding our database, recomputing technical indicators, or regenerating ticker data with updated parameters. Initially, it might seem practical to create individual scripts for each of these actions. However, this approach can quickly become cumbersome and inefficient, especially as the project grows....

July 5, 2024

Precomputing Technical Indicators

The API In this project series, we’re going to build a REST API that exposes resources related to stocks. In this post, we’re going to precompute our technical SMA indicator for our clients to consume through our API. You may find the code in the following repository: https://git.thecodebranch.com/blog/finance-api/src/tag/add-indicators Do We Need to Precompute Data? Let’s say we had customers paying for our API. It would be in our best interest to keep the API as responsive and fast as possible....

July 5, 2024

Finance API

What Are We Building? In this project series, we’re going to build a REST API that exposes resources related to stocks. In this post, we’re going to generate a set data of for the API, so that we have something to play with for the rest of the project. We’re going to generate data because I don’t have real data that I can give you, and secondly, learning how to generate fake data can help you test ideas and build projects....

July 3, 2024