Webinar: Creating data-centric microservices
In this webinar we will focus on Foxx, the microservice framework included in ArangoDB.
Foxx is used to extend the API of ArangoDB with just a couple of lines in JS code. It allows you to move all the logic regarding your data directly into the database which yields the following benefits:
* increased performance all logic is operated as close to the data as possible, no unnecessary data transfer.
* All database details are no longer part of your application.
* You can define fine grained security for your whole dataset.
This webinar is meant as an introduction to the Foxx framework and how to use it.
2. ‣ Monolithic large applications
‣ Run on single server
‣ Loose coupling (object orientation)
2
3. ‣ Few lines of Code
‣ Independently Scalable
‣ Design for failure
‣ Self-handled Persistence
‣ http://martinfowler.com/articles/microservices. html
3
4. ‣ Communication with database
‣ Data-intensive operations
‣ Encapsulate data model
4
μS μS μS
5. ‣ Customize ArangoDB
‣ Abstract from the database
‣ Encapsulate data transformation
‣ Integrate it as a microservice
5
/
(~(
) ) /_/
( _-----_(@ @)
( /
/|/--| V
" " " "
6. ‣ Medical data
‣ requires attribute level security
‣ Nurse and Doctor both read the patient file
‣ Some information should not be read- / writeable for the nurse
‣ Session Service
‣ Simple logic
‣ High dependency on database
‣ Social Data Sharing
‣ User defines which content is shared
‣ Join access rights with data
‣ Likely to collect insufficient amount of data
6
7. ‣ Direct data access
‣ Control outgoing data
‣ Speed improvements
7
8. ‣ Access patterns are complicated
‣ Easier defined in code
‣ Attribute-Level possible
‣ Pattern described by other data
‣ Use startup options:
‣ -- server.authenticate-system-only true
‣ -- server.disable-authentication false
‣ Database user have full access
‣ Foxx users have restricted access
‣ Foxx users != Database users
8
9. ‣ Cleaner code separation
‣ Do not pollute your application code
‣ Move query strings behind the API
‣ Convert data on the fly
‣ No additional update request
9
13. var FoxxController = require("org/arangodb/foxx").Controller,
controller = new FoxxController(applicationContext),
db = require("internal").db;
/** Short description
* Long description
*/
controller.get("byId/:id“, function(req, res) {
var id = req.params("id");
var doc = db.myCollection.document(id);
res.json(doc);
}.errorResponse(ArangoError, 404, "Document not found“)
.pathParam("id", type: joi.string().required().description("Doc id“);
13
14. ‣ How to get started?
‣ Generator in Web Interface
‣ ArangoDB store
‣ https://www.arangodb.com/tutorial-foxx/
14
15. ‣ More features?
‣ Authentication (classic or oauth)
‣ Repository + Models for schema checking
‣ API-Keys
15