title: What are the disadvantages of storing cookies in a database instead of a file?
body: <p>I am working on a service that sits between a client and an API. A client user does API requests via my service. The API requires several user cookies to be set to authenticate the user and allow requests. The client cannot store cookies, so I am storing all the cookies on AWS EFS. The service is written in PHP and API requests are done using cURL. Cookie handling is done using cURL's <code>CURLOPT_COOKIEFILE</code> and <code>CURLOPT_COOKIEJAR</code>.</p>
  
  <p>The problem is that sometimes the cookie file gets overwritten instead of appended to or updated, leading to API requests failing. I am still trying to find the cause of this, but I am considering saving the cookies to the database instead of in a file. Obviously this will lead to an increased database load, but I cannot think of any other disadvantages. Are there any?</p>