M
M
Mimocodil2021-05-24 12:38:12
Software design
Mimocodil, 2021-05-24 12:38:12

How to organize program data management?

The essence is a telegram bot to-do list. There are two MySQL tables: users and cases. Linked by a unique key - telegram user id.
On the program (java) side, there is a class that has two lists that store case and user objects and interact with them. Created even before connecting the database. In this form, the bot worked, but did not save anything after the restart.
I have not yet done it to the end, but in principle I can both save data to the database and unload it from it. It is not clear here that:

Whether these lists are necessary in general if I on request can get the necessary data directly from a DB? I understand that within the framework of the task, the database will not be heavily overloaded, but is it normal to climb into the database for each request?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Mirilaczvili, 2021-05-24
@Ezekiel4

Instead of operations on lists, you work with the database. Getting data from a database is a common thing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question