backbone using extensible database apis over http

14
Backbone with extensible Database APIs and their role in Software Architecture Max Neunhöffer Backbone.js Hackers SF, 18 March 2015

Upload: max-neunhoeffer

Post on 18-Jul-2015

54 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Backbone using Extensible Database APIs over HTTP

Backbone with extensibleDatabase APIs and their rolein Software ArchitectureMax Neunhöffer

Backbone.js Hackers SF, 18 March 2015

www.arangodb.com

Page 2: Backbone using Extensible Database APIs over HTTP

Our motivation and backgroundtriAGENS (mother company of ArangoDB GmbH)

founded in 2004now 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 databasesuch that YOU can build such services.

1

Page 3: Backbone using Extensible Database APIs over HTTP

Typical structure of an application

Database ←→ App Server ←→ Browser←→ Mobile App

(keeps state) (is stateless) (on user’s machine)

2

Page 4: Backbone using Extensible Database APIs over HTTP

Communications flow:

data −→ create view −→ display viewpersist ←− react ←− user action

3

Page 5: Backbone using Extensible Database APIs over HTTP

Agile developmentFacts of life as a software developer/architectSoftware grows, we release frequently and quickly, giverapid feedback, one learns as one goes.

In the beginning . . .the data schema is unclearthe scope of the app is unclearthe list of front end devices is unclearprotocols are not yet sorted outperformance bottlenecks are unknownsecurity requirements and problems are unclear

All these are good things!4

Page 6: Backbone using Extensible Database APIs over HTTP

MicroservicesThese days, everybody talks about microservices:

http://martinfowler.com/articles/microservices.html

Features of a microservice architectureIt is a “particular way of designing software app-lications as suites of independently deployableservices.”We cut the application into services,built around business capabilities. They areindependently deployable (fully automatically!)have well-defined interfaces (often via REST/HTTP),and typically run in their own process.

5

Page 7: Backbone using Extensible Database APIs over HTTP

Initial phase: hack away, rapid prototyping

Features:focused on quick resultsthe database schema keeps changingperformance does not really matterthe user interface undergoes many changes

6

Page 8: Backbone using Extensible Database APIs over HTTP

Consolidation phase

Features:home in on protocols, stabilize themschema stabilizesmaybe more devices and different front-endsstart to think about securityobserve first performance problems

7

Page 9: Backbone using Extensible Database APIs over HTTP

Polishing phase

Features:quality becomes more importantsecurity as wellwe know, which front-ends must be supportedthe protocols are fixed and documentedthe schema is fixed, we want to enforce itperformance matters

8

Page 10: Backbone using Extensible Database APIs over HTTP

The role of the Databaseearly late

schema:flexible, quick results enforcementprotocol:use standard API use specialized servicesauthorization: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

Page 11: Backbone using Extensible Database APIs over HTTP

WANTED: (better alive than dead)

a smart databasethat can be adapted over timewhose API is extensiblecan run performance critical complex queries in the DB,expose them as data-centric microservices via RESThas configurable consistencyhas configurable security features

10

Page 12: Backbone using Extensible Database APIs over HTTP

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 transactionsis 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

Page 13: Backbone using Extensible Database APIs over HTTP

Extensible through JavaScript and FoxxThe 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 withdirect access to the DB engine.Very flexible and secure authentication schemes can beimplemented conveniently by the user in JavaScript.Because JavaScript runs everywhere (in the DB server as wellas in the browser), one can use the same libraries in theback-end and in the front-end.=⇒ can implement your own data-centric microservices

12

Page 14: Backbone using Extensible Database APIs over HTTP

Links

http://martinfowler.com/articles/microservices.html

https://www.arangodb.com

https://github.com/ArangoDB/aye-aye

13