Is 'quick.db" supported on Heroku? - heroku

I receive this error whenever I run an application which requires the quick.db
Here's the error:

There's nothing preventing you from building the quick.db dependency into your application but it will not work as expected. It uses sqlite under the hood which will attempt to store your data in the file system. On Heroku, that file system is ephemeral and your data will be wiped at least once per day.

Related

Laravel app not working after deploying on Heroku

I have a Laravel app working perfectly on my localhost, but when I deploy it on Heroku cloud, it gives the following error,
ErrorException:
file_put_contents(/tmp/build_a3cd0b04/storage/framework/sessions/YZFia5zZhnq2Lz2jZmdD9uZKjiQUU9KnMmRU0oad):
Failed to open stream: No such file or directory
I have tried changing permissions of the storage folder, clearing cache, etc., but nothing works. Any ideas, please?
It looks like you are using the file driver. That isn't a very good choice on Heroku due to its ephemeral filesystem. It won't scale horizontally and sessions will be lost unpredictably (whenever your dyno restarts, which happens at least once per day).
I suggest using the Redis, Memcached, or database driver.
If you already have aa database, that driver is likely easiest. You can use the session:table Artisan command to generate a database migration for holding session data. Commit that migration, update your config/session.php accordingly, redeploy, and run your migrations.
I suspect the cookie driver would also work. Basically, you can use anything but the file driver (or the toy array driver).

Why do I lose contents of my database after a heroku dyno restart?

Anytime my app goes to sleep and comes back on, I lose data in my database
And I'm not storing any media, it's just form data (texts)... I built the app on strapi and I've followed all their guidelines but it keeps happening. I'd be happy if anyone can help
Local data (files, db) is cleared after a Dyno restart because the Heroku File System is ephemeral. A Dyno is restarted (at least) every 24hrs.
In your case Strapi uses SQLite where data is saved in a local file.
Strapi suggests to configure Postgres on Heroku, alternatively you can use an external DB storage service.
First of all:
As you create content types with strapi it generates the code (= new files) for the according controllers/routes/services
Heroku does not persist data after a restart
After a restart strapi checks which content types exist in the code and deletes the tables of nonexisting types from the database.
Therefore, on Heroku you have to set up all your content types locally and connect to an external db (e.g. Heroku Postgres) but never strapi's default textfile based db.
Then push the generated files and finally deploy.
Thus, on Heroku you should always run in production mode. This way the option to alter content types is completely blocked and you will not run into the issue of data loss after a restart.

discord.py how to make a JSON file work on Heroku

When I host the bot using Heroku it no longer calculates the JSON files (even if it makes them work they do not appear) and when I restart it is as if nothing had happened and reset everything.
How can I do?
Heroku does not store changes made to files. Heroku dynos restart every once in a while, and that is when data is lost; redeploying the app can also cause the data to be lost. Using a third-party database, such as MongoDB is recommended.

How to persist Bluemix files between app restarts

I am using a rails 4 application on Bluemix, attaching files using paperclip gem. As we all know, Paperclip is saving a reference to that file in the actual db, saving the physical file into a /public location.
I am submitting a file to this db which is getting saved here
/home/vcap/app/public/files/submissions/files/140/original/Successful_Submission.pdf
and then the file retrieval is working perfectly fine. Once I restart my app, I get:
Errno::ENOENT (No such file or directory # rb_file_s_lstat - /home/vcap/app/public/files/submissions/files/140/original/Successful_Submission.pdf):
And this is because Bluemix is not persisting this information. How can I get hold of those files between app restarts?
Bluemix is built on top of Cloud Foundry and it has an ephemeral filesystem, i.e., once your application stops the platform will claim back that filesystem and creates a brand new one once you restart your application.
Writing to the local filesystem is not recommended for cloud applications and you may need to redesign your application to work with Bluemix. One solution is to save your files in your database and not only the reference.
You can find more details on this link.
Each application instance on Bluemix (which is based on Cloud Foundry) has ephemeral storage. This storage is only available for the lifetime of that particular instance. When you redeploy your app then you'll get a new app instance and any data on the previous app instance will be inaccessible.
There's a good explanation of why it's best to avoid writing to the local file system when designing an application for Bluemix / Cloud Foundry.
You may want to take a look at a gem like CarrierWave to store the files on Amazon S3 or another persistent store. There's also Paperclip which offers similar functionality.

using sqlite database with Windows store app

I guess I am not the first one who encount this issue, but can't find much information after a bit of research. Here is my question:
A windows store app access a sqlite database, the database contains a
few tables, and it is read only. The size of database is 20 MB.
at the starting of the App, it will copy the database to
application folder (if it is not already there). It works fine,
when i test it manually (although it is not lighting fast). but it
always failed badly when testing again the certification test
toolkits, failed at the preformance test with "app crash" or "app
can start" error.
so my question is
1) is this the correct way of using sqlite database in windows
store app? (i mean using a 20MB database locally) or should i port
the data to cloud?
2) is the failure of the certification toolkit really matter? (
will it also means failure of publishing process?)
Thanks in advance
You are going on perfect way. If your app doesn't need Internet connectivity at all then don't go for cloud database. You should use extended splash screen to copy the database, you should not do that thing in App.xaml.cs. If you use cloud database then it will require more time for request-response. I think SQLite transaction is faster than that.
The certification may fail, if you are not using latest version of WACK. If your app fails WACK test, it won't be published.

Resources