Introduction to Foxx by our community member Iskandar Soesman @ikandars

20
Introduction to Foxx A Javascript Framework for ArangoDB By Iskandar Soesman @ikandars

Transcript of Introduction to Foxx by our community member Iskandar Soesman @ikandars

Introduction to FoxxA Javascript Framework for ArangoDB

By Iskandar Soesman @ikandars

About me

● VP engineering @ Kumparan● Ex software architect @ detik● Ex software engineer @ kompas● Founder of Panada PHP

Framework● Social science background but fall

in love in web tech● @ikandars for Twitter, Facebook,

Github● kandar.id for personal blog

The era of NoSQL: Alternative approach to store your data

MongoDBFirst rank in DB-Engines Ranking of Document Stores

FeaturesMongoDB have great cool features

ReplicasetA way to get data

redundancy and high availability

Sharding SchemalessA way to distribute your

data across many serversNo need create your db

scheme in upfront

Document baseJSON like document type.

It easy to embed subdocument

● I need DB with all MongoDB like features.

● I need DB with multi master feature.

● I need NoSQL with built in join feature.

● I need DB with built in Graph feature.

● I need all those features in a single DB vendor.

But why I move to other DB?

Introduce ArangoDB

Key-valueJson

Graph

Three major NoSQL data models in one open-source database

Wait, join in NoSQL DB?

SQL Join

SELECT * FROM users INNER JOIN friends ON (friends.user = users.id);

AQL Join

FOR user IN users FOR friend IN friends FILTER friend.user == user._key RETURN MERGE(user, friend)

ArangoDB also have a Foxx™

Embed your app within your DB server

Foxx™ is a JavaScript framework for writing data-centric HTTP microservices that run directly inside of ArangoDB

You can put any logic into our Google V8 powered JavaScript framework Foxx™ and have full access to the functionality of ArangoDB on C++ level.

Benefits

20XX 20XX 20XX 20XX

Reduced network

overhead

Because Foxx runs directly inside of ArangoDB it lets you bundle all the database queries and logic necessary to handle a request in one place.

Common API application

design

Client

API Application

Database

Foxx can make your app closer

to your DB

Client

APP - Database

Unified data storage logic

By moving the details of your data access and storage logic inside the database and providing a consistent domain specific API to clients, you can shield clients from changes to your internal data structures and know every client will be accessing your database using the same performance optimized queries.

Familiar with Express? You will familiar with Foxx too

Express like route expression

router.get((req, res) => { res.write(` Hello :D This is your database speaking. `)})

Express like route expression

router.get('/hello/:name', (req, res) => { res.write(`Hello ${req.pathParams.name}!`)}).pathParam('name', joi.string().required())

Other features ● Automatic generated Swagger documentation● Full-stack JavaScript● Batteries included: JWT, job queue and bulit in

validation● Infinitely extensible. You can use npm as you

would when using Node.js● Integrate external services via built HTTP client

Thanks