{"id":20744603,"url":"https://github.com/npezza93/solid_storage","last_synced_at":"2025-09-27T18:31:55.533Z","repository":{"id":258241988,"uuid":"873791657","full_name":"npezza93/solid_storage","owner":"npezza93","description":"Active Storage adapter that stores blobs in the database.","archived":false,"fork":false,"pushed_at":"2024-10-18T02:41:19.000Z","size":1077,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-18T05:23:18.482Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/npezza93.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-16T18:15:01.000Z","updated_at":"2024-10-18T02:42:12.000Z","dependencies_parsed_at":"2024-10-18T08:31:45.823Z","dependency_job_id":null,"html_url":"https://github.com/npezza93/solid_storage","commit_stats":null,"previous_names":["npezza93/solid_storage"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npezza93%2Fsolid_storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npezza93%2Fsolid_storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npezza93%2Fsolid_storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npezza93%2Fsolid_storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/npezza93","download_url":"https://codeload.github.com/npezza93/solid_storage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234453409,"owners_count":18835032,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T07:16:18.752Z","updated_at":"2025-09-27T18:31:50.209Z","avatar_url":"https://github.com/npezza93.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Solid Storage\n\nSolid Storage is an Active Storage service adapter that stores blobs in the\ndatabase and serves them using X-Sendfile and adheres to the Active Storage\nservice contract.\n\n## Why?\n\nS3, Azure, R2, GCS all cost money. When starting out and trying to keep costs\nlow, storing files in the database is just fine. So why not just use the disk\nadapter? The disk adapter only works if you are on a single server, and if you\nare on a single server, the disk adapter can be cumbersome to backup. With\ndata in the database, it is easy to backup by incorporating into your current\ndatabase backup process. Having your files easily backup-able will also make\nyour app more portable. Solid Storage also uses X-Sendfile just like the disk\nadapter so you get all the upside of the disk adapter.\n\n## Installation\n\n1. `bundle add solid_storage`\n2. `bin/rails solid_storage:install`\n\nThis will configure Solid Storage as an Active Storage adapter by overwritting `config/storage.yml`, create `db/storage_schema.rb`, and set the production adapter to `:solid_storage`.\n\nYou will then have to add the configuration for the storage database in `config/database.yml`. If you're using SQLite, it'll look like this:\n\n```yaml\nproduction:\n  primary:\n    \u003c\u003c: *default\n    database: storage/production.sqlite3\n  storage:\n    \u003c\u003c: *default\n    database: storage/production_strorage.sqlite3\n    migrations_paths: db/storage_migrate\n```\n\n...or if you're using MySQL/PostgreSQL/Trilogy:\n\n```yaml\nproduction:\n  primary: \u0026primary_production\n    \u003c\u003c: *default\n    database: app_production\n    username: app\n    password: \u003c%= ENV[\"APP_DATABASE_PASSWORD\"] %\u003e\n  cable:\n    \u003c\u003c: *primary_production\n    database: app_production_storage\n    migrations_paths: db/storage_migrate\n```\n\nThen run `db:prepare` in production to ensure the database is created and the schema is loaded.\n\nIt's also recommended to move Active Storage models into the `storage` database\nas well by adding an initializer:\n```ruby\nActiveSupport.on_load(:active_storage_record) do\n  connects_to(database: { writing: :storage })\nend\n```\n\n## Configuration\n\nOptions are set with `config.solid_storage`.\n\nThe options are:\n\n- `connects_to` - set the Active Record database configuration for the Solid Storage models. All options available in Active Record can be used here.\n\n## License\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpezza93%2Fsolid_storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnpezza93%2Fsolid_storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpezza93%2Fsolid_storage/lists"}