elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.61k stars 8.22k forks source link

[data views] moving more functionality server side #113440

Closed mattkime closed 1 month ago

mattkime commented 3 years ago

Original issue - https://github.com/elastic/kibana/issues/90076

The IndexPatternsService is currently being called both client side and server side.

our plan regarding server/client side index patterns goes mostly like this:

mattkime commented 3 years ago

@ppisljar I'm curious about your thoughts about this issue.

Roughly speaking, I think there’s two ways to create APIs. There’s the current way data views is implemented - a thin layer abstracts the saved object layer - vs creating a RESTful api thats consumed by the client. This is probably a topic that can be worked through separate from any thing data view specific.

Saved object layer wrapper

RESTful


ppisljar commented 3 years ago

I don't understand really how this is blocking the index patterns everywhere project.

From my perspective:

I would like to better understand how needed this is ? I think there should be a way to transition gradually. Most of the data view APIs are already the same on client and on server. For some of the functionallity REST apis already exist. We could start rewriting the client to not use common code but use REST endpoints. But i would need to understand why we are doing this in the first place.

vadimkibana commented 3 years ago

our plan regarding server/client side index patterns goes mostly like this:

  • all calls to elasticsearch should be made from server side
  • as much as possible of actual code/logic should exist only on the server
  • server should expose public API (to be consumed by other plugins) as well as REST API (to be consumed by client side and other software outside of kibana when necesarry)
  • client side API should be just a wrapper around REST API mimicking the same interface we have on public interface on the server

+1, I like the plan.


I cannot answer the "need" questions, but I could try explaining why it is a bad idea to use Saved Objects Service on the browser.

But i would need to understand why we are doing this in the first place.


P.S. I understand that connecting directly to database could be a nice modern solution when done well, think Firebase. But in Kibana I think it would be better to keep Saved Objects Service only on the server.

mattkime commented 3 years ago

@vadimkibana At this point I put most of those benefits under 'marginal improvements' - they would be good to have but the current situation isn't blocking anything from happening.

elasticmachine commented 1 year ago

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

kertal commented 1 month ago

Closing this because it's not planned to be resolved in the foreseeable future. It will be tracked in our Icebox and will be re-opened if our priorities change. Feel free to re-open if you think it should be melted sooner.