HN user

tappleby

3 karma
Posts0
Comments7
View on HN
No posts found.

There are also some limitations if using something like rails / activerecord which doesn't support composite primary keys natively

Are there any strategies for migrating from a separate db per tenant to shared db with scoped tenant_id? In this case each tenant would have overlapping primary keys.

JSON Schema 8 years ago

We have a similar setup for extending our app with custom fields / forms using ruby-json-schema and react-jsonschema-form [1].

ruby-json-schema has worked out quite well, we added a custom schema reader so that we could generate enums dynamically based on records in the database via custom refs eg. app://schemas/organizations?type_eq=education&tags=one, any of these internal refs are inlined at the API layer.

One issue we did run into with ruby-json-schema, is the schema caching is not thread safe. We opted to clear the cache after each validation, this ended up causing race-condition issues. In the end we had to use a mutex on write and cache the validation result (not ideal, but our app isn't that write heavy).

[1] https://github.com/mozilla-services/react-jsonschema-form