sqlite on Heroku (production, in memory) - ruby

We want to use sqlite, via the sqlite3 gem in Ruby in a production app on Heroku. However, heroku detects the gem, and blocks our deploys.
We're aware heroku's filesystem is ephemeral, but we're using SQLLite's in memory mode for a short lived database in a background worker. Heroku blocks the gem because they worry people will attempt to use it as a persistent database and be surprised when their data disappears (see link below). I can appreciate their concern, but we have a legitimate use case, and are still blocked.
Are there are any work arounds to the nanny-check heroku adds if you have a legitimate use case for sqlite?
Edit: Please note, we are not looking for alternative tool suggestions. We already have a "real" database with terabytes of data. We're loading data into a local temp DB as a legit optimization. sqlite lite works great on Heroku using any other language binding. I'm just looking for a way around Heroku's nanny-check to use Ruby + sqlite.
https://devcenter.heroku.com/articles/sqlite3

Unfortunately, Heroku doesn't support SQLite on its architecture basis. You should migrate to PostgreSQL. But I know the solution without migrating - Dokkur - Heroku analogue.

I don't think you have a lot of options here. Heroku doesn't allow the use of SQLite.
You can still use a PG table as a generic, short-lived, database. Or if you just need a simple storage and you don't need advanced querying mechanisms, you can use Redis.
Both are available from Heroku.

Related

Caching on Heroku CI

I am setting up Heroku CI with Elixir Phoenix buildpack. I want to start using Dialyzer.
Diazlyer is a static analysis tool that before the first run takes at least a couple of minutes to create a "persistent lookup table" (PLT) of types from Erlang, Elixir and project dependencies. Later, project analysis is much quicker. I want to cache the PLT.
I've found this section on caching during build: https://devcenter.heroku.com/articles/buildpack-api#caching but I can't find anything about caching in test-setup or test script.
Is there test/CI cache or is it only usable in buildpacks?
(Tomasz, I know that you already have found a path how to approach this problem, but I will share here publicly what I have shared with you privately so that others might also benefit.)
Is there test/CI cache or is it only usable in buildpacks?
Seems that in test/CI you can not do it, you have to use a buildpack. Or maybe hold the cache somewhere outside of Heroku (seems like not a good way to me though).
Have you seen this https://github.com/tsloughter/heroku-buildpack-erlang-dialyzer? It seems dated but maybe it has some hint that can be useful to you.
Setting up backpacks is rather straight forward and for your need this seems the only option that would support caching.

Is Heroku a replacement for a VPS?

We're currently evaluating Heroku to replace the initial workflow of renting a VPS for a small Web App (since we're working on NodeJS, cPanel hosting plans aren't enough, ergo, VPS).
The confusion lies in Heroku's actual usage as even though it's clear it's used as a platform as a service, there is no Disk (HDD/SSD) limit described.
Web App requirement includes file upload capabilities (profile picture, etc) so I'm not sure Heroku is what we need. Can I get a clear explanation on this?
Not a Heroku expert, but...
You could always use one of the various add-ins that offer database support for storing your images until that no longer works
As the usage of your site scales out, you'd probably want to place static content into a CDN.
I wouldn't consider placing files into Heroku that weren't related to running code and honestly I don't even know if you can.
(I originally just wanted to comment, but need a higher rep :/)

How does Node.JS and/or Meteor get a callback from the database when a 3rd party software update the database

I would like to use Meteor (Node.JS) to develop an application that will be used by 3,000+ concurrent users on a large size database.
I have looked at the nice examples and the idea to push changed data to the clients is very nice and very useful, but before I start the development I want to be sure how it works behind the scenes to be sure that when I have the application running with all these users it work fast with standard hardware.
I also require this to use Oracle as a database, but not sure that it is supported and if not, what are the requirements from an Oracle package to enable this facility.
I think that the server is having an active on going non-blocking query on the OPLOG table in mongodb and that is how we get the callback for all the changes in the database. Is that correct ? if so, is there a similar way to do it in Oracle ?
Thanks Roni.
I also require this to use Oracle as a database, but not sure that it is supported and if not, what are the requirements from an Oracle package to enable this facility.
Nope, meteor is currently mongo-only as they have implemented an in-browser library called minimongo. My guess is this project will never support oracle, but who knows. There is no mention of oracle support on the meteor project roadmap
Just happened to come across this question while searching at google.
However, if there are no native solutions. We can always figure out a way for a medium language to issue publishing.
Example Case:
Python will be used for synchronising data between Mongodb and Oracle (24/7 operation using cx_Oracle and MongoDB drivers from python)
Meteor Server will keep watch on what to publish
Meteor clients/browsers that subscribed to the channel that will be updated with oracle data.

Is there a database or persistent storage, packaged in a Ruby gem?

I have a simple Sinatra application that needs some persistence storage. If possible, that database should offer some access by id, and keyword search/find options.
Considering the nature of the to-be stored items, a document-based database seems the best fit.
Obviously I have considered MongoDB and CouchDB, but all have one problem: they introduce dependencies on third party services. I don't want that.
My users should install the Sinatra app as a gem, with its dependencies, run a single command and have everything running.
I am looking for solutions that come as a gem, run under the current user and are really simple. A prepackaged mongoDB would do, too, but I cannot find such a thing. Is SQLlite my only option?
It sounds like you want DBM (which gives you access by id) and Ruby/odeum which gives you keyword search.
You may want to consider either a self-standing database like SQLite and Redis (no-SQL), or an ORM like DataMapper.

Accessing a database simultaneously from multiple applications using Sequel

If I use Sequel in a Ruby app like this:
DB = Sequel.sqlite('testdb.db')
does it make the database shared? Can I acces this same file from a different ruby app AT THE SAME TIME and get the database to perform locking etc?
I'm thinking probably not and i'd have to actually have a separate instance of the database running.
Yes, if you use a file backed database, you can access it by multiple processes. They don't even have to be ruby processes. Note that in SQLite, writers block all readers, so multi-process or multi-threaded write performance is not very good.
This is not up to neither Ruby nor Sequel. It's up to sqlite. Take a look at sqlite FAQ, and see whether it answers your question.

Resources