I have an app which starts with a login. This process involves contacting the online database.
Now after a successful login, I want to access the database further (read some data/write something else). Is it advisable to make another connection again. Meaning every time I need to access some data, should I make a http connection?
Or should I read all the required data while checking for login credentials and avoid making http connections often?
For obvious reasons doing an http request is a bad idea, but is there a way to avoid it?
And secondly, how should I use the instance of the first connection. What I mean to ask is, should I login into the database each time I want to access it? Or can I use the instance of the connection which was made during the login operation in the beginning?
Thanks in advance.
As Reto Meier describes in his book. This is good behavior for your application to implement the economy of net traffic and so to economy your user’s money.
In my opinion you should always try to cache data from internet and update it considerable number of times.