Recommended Setup for recording candlesticks in all time frames

Hello,

I’m creating a charting software like

What is your recommended setup for recording candlesticks in all time frames (1 minute, 3 minutes, 5 minutes, 15 minutes, 1 hour, 2 hours, 4 hours, 1 day)

I want to record all cryptocurrencies from Binance

What I’m thinking right now is: (But something inside me tells me It’s not a good setup!)
If I record all trades from Binance is there any way to calculate 1m, 3m, …, 1h, 4h, 1day intervals instead of storing them?

#1 - Bitcoin
“btcusd_1m open=123,close=123,high=123,low=123,volume=123 timestamp”
“btcusd_3m open=123,close=123,high=123,low=123,volume=123 timestamp”

“btcusd_1h open=123,close=123,high=123,low=123,volume=123 timestamp”
“btcusd_4h open=123,close=123,high=123,low=123,volume=123 timestamp”
“btcusd_1D open=123,close=123,high=123,low=123,volume=123 timestamp”

#2 - Ethereum
“ethusd_1m open=123,close=123,high=123,low=123,volume=123 timestamp”
“ethusd_3m open=123,close=123,high=123,low=123,volume=123 timestamp”

“ethusd_1h open=123,close=123,high=123,low=123,volume=123 timestamp”
“ethusd_4h open=123,close=123,high=123,low=123,volume=123 timestamp”
“ethusd_1D open=123,close=123,high=123,low=123,volume=123 timestamp”

#3 - …

Regards,
John