38
RethinkDB, horizon RethinkDB, horizon Introduction to create the real time web application.

Introduction to RethinkDB and Horizon.js

Embed Size (px)

Citation preview

Page 1: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

RethinkDB, horizon

Introduction to create the real time web application.

Page 2: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

About me

Page 3: Introduction to RethinkDB and Horizon.js

@chuck0523

25yo like JavaScript

Junior Front-End developer

Page 4: Introduction to RethinkDB and Horizon.js

0

25

50

75

100

HTML CSS JavaSript Ruby PHP

RethinkDB, horizon

My skills

Page 5: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

My recent job

‣ Create SPA by React, Redux, CSS Modules, PostCSS with Webpack, on Rails as API server.

Page 6: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

It’s on Medium

Page 7: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

That’s it about me

Page 8: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

Let’s dive into RethinkDB & horizon!!

Page 9: Introduction to RethinkDB and Horizon.js

The open-source database

for the realtime web

RethinkDB, horizon

RethinkDB

Page 10: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

RethinkDB

‣ OpenSource NoSQL DB

‣ Since July 2009

‣ For realtime web app

‣ Written in C++

‣ Stores JSON

‣ 15000 stars on Github

Page 11: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

ReQL

RethinkDB is using ReQL (DSL)

Available in Java, Ruby, Python, JavaScript

Page 12: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

SQL to ReQL

Insert in SQL

Page 13: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

SQL to ReQL

Insert in ReQL

Page 14: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

Select statement

SQL ReQL

Page 15: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

Update statement

SQL ReQL

Page 16: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

Delete statement

SQL ReQL

Page 17: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

Joins in ReQL

Page 18: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

Aggregation in ReQL

“Group by” in SQL

Page 19: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

Totally NoSQL.

Seems to be super easy and fun!

Page 20: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

That’s all about ReQL

Page 21: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

How can we start ?

Page 22: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

$ brew install rethinkdb

Page 23: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

RethinkDB in Rails

https://www.rethinkdb.com/docs/rails/

Page 24: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

RethinkDB in Others

https://github.com/rethinkdb/?utf8=%E2%9C

You can also use Angular, Express, Node…

Page 25: Introduction to RethinkDB and Horizon.js

The realtime JavaScript backend

RethinkDB, horizon

Horizon.js

Page 26: Introduction to RethinkDB and Horizon.js

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

Page 27: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

Let’s take a look at sample code

Page 28: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

Two core classes in Horizon.js

Page 29: Introduction to RethinkDB and Horizon.js

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

Page 30: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

1. Horizon class

Page 31: Introduction to RethinkDB and Horizon.js

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

Page 32: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

Collection.store

Page 33: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

Collection.watch

Page 34: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

Rx returnable methods

‣ Collection.watch returns RxObservable

‣ We can use RxObservable’s method

‣ map, filter, mergeMap, toArray…

Page 35: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

Collection.methods are for Back-end (RethinkDB).

RxObservable.methods are for Front-end (React or something).

Page 36: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

https://www.rethinkdb.com/docs/sharding-and-replication/

We got basic of RethinkDB & Horizon.js now

http://horizon.io/docs/getting-started/

Page 37: Introduction to RethinkDB and Horizon.js

RethinkDB, horizon

It’s time to DEMO

Page 38: Introduction to RethinkDB and Horizon.js

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