Is JSONB + Postgres still a viable way of storing varying attributes?

This page summarizes the projects mentioned and recommended in the original post on /r/rails

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • jsonb_accessor

    Adds typed jsonb backed fields to your ActiveRecord models.

  • I use both https://github.com/madeintandem/jsonb_accessor and https://github.com/DmitryTsepelev/store_model for storing different types of JSONB data in my Rails app. jsonb_accessor is great for lightweight, non-queryable('ish) fields, and StoreModel is great for mapping JSON documents to model-type records.

  • StoreModel

    Work with JSON-backed attributes as ActiveRecord-ish models

  • I use both https://github.com/madeintandem/jsonb_accessor and https://github.com/DmitryTsepelev/store_model for storing different types of JSONB data in my Rails app. jsonb_accessor is great for lightweight, non-queryable('ish) fields, and StoreModel is great for mapping JSON documents to model-type records.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • attr_json

    Serialized json-hash-backed ActiveRecord attributes, super smooth

  • I myself maintain one solution meant for rails attributes stored in a json column, at https://github.com/jrochkind/attr_json

  • store_attribute

    ActiveRecord extension which adds typecasting to store accessors

  • There are some other gems that can do similar things (each with somewhat different design and possibilities) including https://github.com/madeintandem/jsonb_accessor , https://github.com/DmitryTsepelev/store_model , and https://github.com/palkan/store_attribute

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts