horizon
horizon copied to clipboard
Create options for basic REST endpoints for data ingress / webhooks
Similar to https://www.firebase.com/docs/rest/guide/saving-data.html
Given a pre-existing database, Horizon should have a way to allow people to ingest large .json
dumps into Horizon. I got this question a fair number of times at OSCON from people thinking about how to move their data into Horizon.
Currently, your best bet is to hope that your data is in a format which is usable by rethinkdb import
and then ingesting data that way. But this assumes you have experience with RethinkDB or are comfortable performing these kind of operations. Even thought it will definitely take longer for large datasets, making HTTP requests is definitely much simpler and easier for the smaller transferrals of application datasets.
It would be helpful to enable some sort of basic REST API:
hz serve --rest
POST
https://localhost:8181/horizon/rest/[table_name]
GET, PUT
https://localhost:8181/horizon/rest/[table_name]/[primary_id]
This would also help for people who have incoming data from other services and just need an endpoint to point some sort of webhook towards. In this case, origin domains could be whitelisted or some sort of access token could be provided as a query param (given TLS).
+1 - this should be a first class usecase
+1 https://www.bountysource.com/issues/34578040-create-options-for-basic-rest-endpoints-for-data-ingress-webhooks
This would enable me to get started with Horizon as I have a a possessive web app it doesn't assume good connectivity. So it will start with rest and work it's way up to real time. What can I do to help get this started?
+1
Hey @marcus7777 @sylvainlap, when we release our Plugins (#588) implementation, this will issue will be easy to fix and also very customizable to your needs. Hold on tight.
+1
As a work around for data ingress, I opened an endpoint on my current server and used r.http from the Rethink Admin Console to ingest the data dump.
+1 for REST transport on Horizon services. Since rethinkdb
users/permissions are different than horizon
users/permissions, if I want to user Horizon for my webapp then my "sources of truth" for security is Horizon. Goodbye ReQL... :(
Possibly some sort of http://feathersjs.com/ integration might work well e.g. feathers-horizon
...
I took a crack at an example showing how to run the horizon client on the server side in Express and mapping REST CRUD endpoints. Still needs a lot of work, but just fishing for direction right now.
https://github.com/ubergarm/stack-in-a-box
Talking with @segphault yesterday, it probably makes sense to make a plugin for basejump, since a lot of this stuff has been hammered out already very thoughtfully.
basejump? link please :)
@marcus7777 the github repo is here, but there isn't much documentation yet: https://github.com/segphault/basejump-router For more details, you can check out the YouTube video of a presentation where I demoed an early version of it: https://www.youtube.com/watch?v=UxFgkCUiRAI