timwis / dataface

Build and manage data with a spreadsheet-like interface
https://dataface-demo.herokuapp.com
43 stars 4 forks source link

Decide back-end platform #1

Closed timwis closed 7 years ago

timwis commented 7 years ago

Below are all the things I imagine the back-end will need to perform.

Reading

Writing (also notifications if other users write)

Relationships

We want users to be able to associate a record in one table with a record in another table. Fieldbook takes the approach of always making this relationship many-to-many. My assumption is because that relationship is easiest for less technical users to understand: records are simply "associated" with one another, so why shouldn't a post have more than one user associated with it?

If many-to-many meets the most use cases then I think we should build for that. The question is whether there's a use case that many-to-many can't accommodate?

As far as how to accomplish this, one way (perhaps the only) is to have a joins table with left and right fields containing the record ids. Although what if you want your posts table to have an author field and an editor field, both linking to the users table? We'd need to associate the joins table records with a particular relationship, requiring a relationships table. Too complex?

Back-end options

PostgresT

Kinto

Thoughts? Other options?

themightychris commented 7 years ago

postgrest + lapidus gets you realtime

I don't think postgresql will let you change a field type if it will make existing values invalid

timwis commented 7 years ago

I started building on PostgREST but I'm looking over my shoulder now because there's no built-in way to add/alter/drop columns, so we'll have to use stored procedures (plus figure out how to send a HUP signal to the postgrest application) (#13), and that feels a bit like starting to make our own back-end...

On a separate note, I came across a related API generator from IBM called LoopBack. Probably the cool part of IBM.

timwis commented 7 years ago

Things are pretty well underway with postgrest. It's been abstracted to the point where I don't expect it would be too dramatic to change, but I expect we can close this issue for now.