Hacker News new | past | comments | ask | show | jobs | submit login

I don't know that I like "data first".

Every greenfield project starts with a data model, but eventually gets encumbered in lots of crazy, bespoke business logic. This happens 6 months to 2 years into a project when some person asks for "one little thing". I'd love to see people who have used this for a while talk about data migrations, constraints, and all the other cruft that ends up happening in software development of CRUD.

This reminds me of Microsoft Sharepoint without all the widgets (which is what I meant when I said "visual") or Salesforce or even Microsoft Access. All of which are fairly difficult to manage, but appeal to a certain kind of customer.

The problem comes in when you have some complex business logic (you need 2 levels of approval on a Tuesday to publish this data)

I'd rather write all that stuff in a popular programming language.




While true, any data model is susceptible to cruft, no matter what stack you use.

For complicated rules like your example use case, you can add anything you want to the client-side validation hooks. In fact, almost all data validation currently happens client-side.

It's true that you'd not be able to enforce anything particularly complex if you submit writes directly to the API, but we're planning on supporting webhook-based validation, where you register a webhook that will receive documents for approval. We've successfully used this pattern in past projects. For example, something that isn't easily expressed declaratively is Hacker News' rule that thread comments are only editable a certain amount of time after they're submitted. We, too, prefer this kind of thing to be implemented in code.

Disclosure: I work on the data store, but not on Sanity itself.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: