Backbone using Extensible Database APIs over HTTP

897 Aufrufe

Veröffentlicht am

These days, more and more software applications are designed using a micro services architecture, that is, as suites of independently deployable services, talking to each other with well-defined interfaces. This approach is helped by the fact that many NoSQL databases expose their API through HTTP, which makes it particularly easy to define the interfaces.

The multi-model NoSQL database ArangoDB embeds Google's V8 JavaScript engine and features the Foxx framework, which allows the developer to extend ArangoDB's API by user defined JavaScript code that runs on the database server.

In this talk I will explain the benefits of this approach to the software architecture and development process. I will keep the presentation practice oriented by showing concrete examples in ArangoDB and JavaScript, using Backbone.js

Veröffentlicht in: Technologie
0 Kommentare
1 Gefällt mir
  • Als Erste(r) kommentieren

Keine Downloads
Aufrufe insgesamt
Auf SlideShare
Aus Einbettungen
Anzahl an Einbettungen
Gefällt mir
Einbettungen 0
Keine Einbettungen

Keine Notizen für die Folie

Backbone using Extensible Database APIs over HTTP

  1. 1. Backbone with extensible Database APIs and their role in Software Architecture Max Neunhöffer Backbone.js Hackers SF, 18 March 2015
  2. 2. Our motivation and background triAGENS (mother company of ArangoDB GmbH) founded in 2004 now 15 years of experience in building databases: in-memory Stock Information System (∼ 2000) OLAP business intelligence software, in-memory hyper-cube database architecture (2006) high-security session service for e-Post Brief (German Postal Service, 2010) made NoSQL solutions long before the term existed We care about database technology! In 2012 we wanted to make a generic database such that YOU can build such services. 1
  3. 3. Typical structure of an application Database ←→ App Server ←→ Browser ←→ Mobile App (keeps state) (is stateless) (on user’s machine) 2
  4. 4. Communications flow: data −→ create view −→ display view persist ←− react ←− user action 3
  5. 5. Agile development Facts of life as a software developer/architect Software grows, we release frequently and quickly, give rapid feedback, one learns as one goes. In the beginning . . . the data schema is unclear the scope of the app is unclear the list of front end devices is unclear protocols are not yet sorted out performance bottlenecks are unknown security requirements and problems are unclear All these are good things! 4
  6. 6. Microservices These days, everybody talks about microservices: Features of a microservice architecture It is a “particular way of designing software app- lications as suites of independently deployable services.” We cut the application into services, built around business capabilities. They are independently deployable (fully automatically!) have well-defined interfaces (often via REST/HTTP), and typically run in their own process. 5
  7. 7. Initial phase: hack away, rapid prototyping Features: focused on quick results the database schema keeps changing performance does not really matter the user interface undergoes many changes 6
  8. 8. Consolidation phase Features: home in on protocols, stabilize them schema stabilizes maybe more devices and different front-ends start to think about security observe first performance problems 7
  9. 9. Polishing phase Features: quality becomes more important security as well we know, which front-ends must be supported the protocols are fixed and documented the schema is fixed, we want to enforce it performance matters 8
  10. 10. The role of the Database early late schema: flexible, quick results enforcement protocol: use standard API use specialized services authorization: does not matter matters greatly (want to be flexible) security: does not matter matters greatly (want to be hardened) performance: does not matter mission critical (no real example data) (have a lot of data) Conclusion: DB needs to change! 9
  11. 11. WANTED: (better alive than dead) a smart database that can be adapted over time whose API is extensible can run performance critical complex queries in the DB, expose them as data-centric microservices via REST has configurable consistency has configurable security features 10
  12. 12. is a multi-model database (document store & graph database), is open source and free (Apache 2 license), offers convenient queries (via HTTP/REST and AQL), including joins between different collections, configurable consistency guarantees using transactions is memory efficient by shape detection, uses JavaScript throughout (Google’s V8 built into server), API extensible by JS code in the Foxx Microservice Framework, offers many drivers for a wide range of languages, has web front end (using backbone.js!), and enjoys good community as well as professional support. 11
  13. 13. Extensible through JavaScript and Foxx The HTTP API of ArangoDB can be extended by user-defined JavaScript code, that is executed in the DB server for high performance. This is formalised by the Foxx microservice framework, which allows to implement complex, user-defined APIs with direct access to the DB engine. Very flexible and secure authentication schemes can be implemented conveniently by the user in JavaScript. Because JavaScript runs everywhere (in the DB server as well as in the browser), one can use the same libraries in the back-end and in the front-end. =⇒ can implement your own data-centric microservices 12
  14. 14. Links 13