Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Introduction to RethinkDB and Horizon.js

1,902 views

Published on

Introduction to RethinkDB and Horizon.js

Published in: Technology
  • Be the first to comment

Introduction to RethinkDB and Horizon.js

  1. 1. RethinkDB, horizon RethinkDB, horizon Introduction to create the real time web application.
  2. 2. RethinkDB, horizon About me
  3. 3. @chuck0523 25yo like JavaScript Junior Front-End developer
  4. 4. 0 25 50 75 100 HTML CSS JavaSript Ruby PHP RethinkDB, horizon My skills
  5. 5. RethinkDB, horizon My recent job ‣ Create SPA by React, Redux, CSS Modules, PostCSS with Webpack, on Rails as API server.
  6. 6. RethinkDB, horizon It’s on Medium
  7. 7. RethinkDB, horizon That’s it about me
  8. 8. RethinkDB, horizon Let’s dive into RethinkDB & horizon!!
  9. 9. The open-source database for the realtime web RethinkDB, horizon RethinkDB
  10. 10. RethinkDB, horizon RethinkDB ‣ OpenSource NoSQL DB ‣ Since July 2009 ‣ For realtime web app ‣ Written in C++ ‣ Stores JSON ‣ 15000 stars on Github
  11. 11. RethinkDB, horizon ReQL RethinkDB is using ReQL (DSL) Available in Java, Ruby, Python, JavaScript
  12. 12. RethinkDB, horizon SQL to ReQL Insert in SQL
  13. 13. RethinkDB, horizon SQL to ReQL Insert in ReQL
  14. 14. RethinkDB, horizon Select statement SQL ReQL
  15. 15. RethinkDB, horizon Update statement SQL ReQL
  16. 16. RethinkDB, horizon Delete statement SQL ReQL
  17. 17. RethinkDB, horizon Joins in ReQL
  18. 18. RethinkDB, horizon Aggregation in ReQL “Group by” in SQL
  19. 19. RethinkDB, horizon Totally NoSQL. Seems to be super easy and fun!
  20. 20. RethinkDB, horizon That’s all about ReQL
  21. 21. RethinkDB, horizon How can we start ?
  22. 22. RethinkDB, horizon $ brew install rethinkdb
  23. 23. RethinkDB, horizon RethinkDB in Rails https://www.rethinkdb.com/docs/rails/
  24. 24. RethinkDB, horizon RethinkDB in Others https://github.com/rethinkdb/?utf8=%E2%9C You can also use Angular, Express, Node…
  25. 25. The realtime JavaScript backend RethinkDB, horizon Horizon.js
  26. 26. RethinkDB, horizon Horizon.js ‣ OSS JavaScript Framework ‣ Created by RethinkDB ppl ‣ On RethinkDB and Node.js ‣ Subscribes App state ‣ Using RxJS Internally ‣ Auth and Permission
  27. 27. RethinkDB, horizon Let’s take a look at sample code
  28. 28. RethinkDB, horizon Two core classes in Horizon.js
  29. 29. RethinkDB, horizon 1. Horizon class ‣ Horizon class takes care of instantiation and management connection ‣ Pass a string to object of Horizon class, then collection is returned
  30. 30. RethinkDB, horizon 1. Horizon class
  31. 31. RethinkDB, horizon 2. Collection class ‣ Collection class deals with create, read, update and delete data ‣ Some methods return RxObservable, which enables us to use RxObservable’s methods
  32. 32. RethinkDB, horizon Collection.store
  33. 33. RethinkDB, horizon Collection.watch
  34. 34. RethinkDB, horizon Rx returnable methods ‣ Collection.watch returns RxObservable ‣ We can use RxObservable’s method ‣ map, filter, mergeMap, toArray…
  35. 35. RethinkDB, horizon Collection.methods are for Back-end (RethinkDB). RxObservable.methods are for Front-end (React or something).
  36. 36. RethinkDB, horizon https://www.rethinkdb.com/docs/sharding-and-replication/ We got basic of RethinkDB & Horizon.js now http://horizon.io/docs/getting-started/
  37. 37. RethinkDB, horizon It’s time to DEMO
  38. 38. RethinkDB, horizon Thanks for listening Codes of DEMO are on Github repo. You can pull and try it. https://github.com/chuck0523/learning-langs/tree/gh-pages/js/reChat

×