O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Use Cases of Elasticsearch and Considerations in Multi-tenancy

Agenda

- About us and our product
- Our use cases of Elasticsearch
- Combination with RDB
- Considerations in Multi-tenancy
- How do we search private documents ?
- Self-Managed vs Amazon ES

  • Entre para ver os comentários

  • Seja a primeira pessoa a gostar disto

Use Cases of Elasticsearch and Considerations in Multi-tenancy

  1. 1. Use Cases of Elasticsearch AND Considerations in Multi-tenancy 2016-09-14 eurie Inc. Takahiro Ikeuchi
  2. 2. Agenda About us and our product Our use cases of Elasticsearch Combination with RDB Considerations in Multi-tenancy How do we search private documents ? Self-Managed vs Amazon ES 2
  3. 3. Conclusion 3
  4. 4. Conclusion In the case of Multi-tenancy model, processing Authentication and Authorization should be handled by your backend applications. If a strict synchronous execution is not needed, an asyncronous execution using AWS Labmda is a good option. You may want to implement wrapper logics to standardize interfaces. I would recommend that you adopt "self- managed" until Amazon ES supports VPC. 4
  5. 5. About us and our product 5
  6. 6. Author Takahiro Ikeuchi @iktakahiro Company / Community eurie Inc. Founder & CEO SQUEEZE Inc. Tech Adviser PyData.Tokyo Organizer Specialties (or just a dabbler :-D Go lang, Python, React.js, TypeScript Cloud Infrastructure, UI Design etc... 6
  7. 7. 7
  8. 8. A Customer Support Tool for Innovative Teams 8
  9. 9. Architectures RESTful API Go lang (framework: echo) Single Page Application React.js + Typescript Elasticsearch Cloud Native AWS Aurora, Lambda, CloudFront, WAF... Microservice Architecture 9
  10. 10. Now in Private Beta!! https://eurie.io 10
  11. 11. Our use cases of Elasticsearch 11
  12. 12. Searching Message 12
  13. 13. 13
  14. 14. Why Elasticsearch ? 14
  15. 15. Why Elasticsearch? Full-Text Search Morphological Analysis High-Performance / Scalable Powerful weighted-search, sort, lter Similar documents Recommendations Pretty REST API, Client Library etc... 15
  16. 16. Architecture 16
  17. 17. Architecture 17
  18. 18. GET docs from Elasticsearch 18
  19. 19. The ow of searching messages 1. A user enters a keyword in the client app. A client sends a GET Request to a REST API on the backend app. 2. The REST API receives the GET Request. Authentication / Authorization 3. The backend app sends a GET Request to Elasticsearch Receiving search-results. 4. The backend app builds / returns a response. 5. The client app receives the response from the REST API. Rendering User-Interfaces. 19
  20. 20. GET docs from Elasticsearch 20
  21. 21. Web API Design 21
  22. 22. Web API Design GET /meesage/search?q=word&page=1&per_page=10 Response Body { "took": 36, "_scroll_id": "", "hits": { "total": 1, The above JSON is a responce of Elasticsearch itself. It was not changed. 22
  23. 23. Web API Design Response Header Link: Createing a Response Header: Link based on total (and the others) value in a search-result. RFC 5988 - Web Linking https://tools.ietf.org/html/rfc5988 </messages/search?q=gmail&page=1&per_page=10>; rel="first", </messages/search?q=gmail&page=2&per_page=10>; rel="next", </messages/search?q=gmail&page=2&per_page=10>; rel="last" 23
  24. 24. Combination with RDB 24
  25. 25. Considerations in combination with RDB Would you really need RDB? Would you need a strict synchronous? Is UPDATE/DELETE executed frequently? In the case of eurie Desk : At the rst, all documents are inserted into RDB (Amazon Aurora). Just after inserting, documents are also put to Elasticsearch asynchronously. Elasticsearch is used on write-only situations. 25
  26. 26. POST docs to RDB 26
  27. 27. PUT docs to Elasticsearch (Async) 27
  28. 28. Considerations in Multi-tenancy 28
  29. 29. The case of Multi-tenancy model â Issues A user or role based access controll system for documents is needed. Documents should not be able to referred by other tenants. How do we search private documents? 29
  30. 30. The case of Multi-tenancy model Solutions You should build Elasticsearch in a internal (private) network. A processing Authentication and Authorization should be handled by your backend apps. Of couse use Index for each tenant. 30
  31. 31. RDB and ES instances boot in the Private Network 31
  32. 32. Amazon ES Pros/Cons Amazon ES = Amazon Elasticsearch Service https://aws.amazon.com/elasticsearch-service/ Pros Very easy, even High-Available structures. By default, Amazon ES has Kuromoji-plugin. So you can use Elasticsearch immediately. 32
  33. 33. Amazon ES Pros/Cons Cons It's only booted in a global netowrk area. IP Restrictions OK, but we can't use "Secuirty Groups". Or there is an option to develop a system using "IAM"... Is the newest version of Elasticsearch released immediately? We don't have permission to install plug-in freely. 33
  34. 34. Self-Managed vs Amazon ES If you want use Elasticsearch to search none- private documents, It might be that adopting Amazon ES is a wise way. On the other hand, in the case of private documents, consider to adopt Self-Managed. It's layer is same as RDB. I hope Amazon ES supports soon. 34
  35. 35. Conclusion In the case of Multi-tenancy model, processing Authentication and Authorization should be handled by your backend applications. If a strict synchronous execution is not needed, an asyncronous execution using AWS Labmda is a good option. You may want to implement wrapper logics to standardize interfaces. I would recommend that you adopt "self- managed" until Amazon ES supports VPC. 35
  36. 36. Appendix Elasticsearch o cial site Elasticsearch client library for Go lang: olivere/elastic eurie.io 36

×