Post-relational databases: What's wrong with web development? v3
Upcoming SlideShare
Loading in...5
×
 

Post-relational databases: What's wrong with web development? v3

on

  • 1,746 views

Pogledat ćemo kako se razvoj aplikacija mijenjao kroz vrijeme i koji je najjednostavniji način da napravimo web aplikaciju korištenjem JavaScript-a i JSON-a koji nam omogućavaju brz i jednostavan ...

Pogledat ćemo kako se razvoj aplikacija mijenjao kroz vrijeme i koji je najjednostavniji način da napravimo web aplikaciju korištenjem JavaScript-a i JSON-a koji nam omogućavaju brz i jednostavan razvoj aplikacija uz pomoć Angulara i CouchDB-a. Cilj je napraviti aplikaciju za jedno popodne!

Statistics

Views

Total Views
1,746
Views on SlideShare
1,744
Embed Views
2

Actions

Likes
2
Downloads
8
Comments
0

2 Embeds 2

http://twitter.com 1
http://10.150.200.76 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Post-relational databases: What's wrong with web development? v3 Post-relational databases: What's wrong with web development? v3 Presentation Transcript

    • 1/18Post-relational databases Whats wrong with web development? Dobrica Pavlinušić http://blog.rot13.org WebUG, 2011-06-16
    • 2/18 Who am I?● Web programming since 1995 using FLOSS● Languages: php, perl, JavaScript● Databases: PostgreSQL, MySQL, CouchDB● 5+ years of expirience as system architect on large intranet content portal● http://blog.rot13.org● Big question: are we solving same problems over and over again?● Model-View-Controller pattern
    • 3/18 Back in mainframe days... View serial Controller Model text text COBOL files Terminal Server ● All logic in COBOL application ● Similar to Clipper in DOS ● Payroll-type applications1970 ... 1975 ... 1980 ... 1985 ... 1990 ... 1995 .. 2000 ... 2005 ... 2010
    • 4/18 GUI Client/Server RDBMS View Controller SQL GUI API Model 4GL ODBC RDBMS Client Server ● tabular normalized data (3NF) ● SQL to query and modify data (static schema) ● logic in controller and RDBMS (validation)1970 ... 1975 ... 1980 ... 1985 ... 1990 ... 1995 .. 2000 ... 2005 ... 2010
    • 5/18 Internet! Web 1.0 View Controller HTTP Model HTML HTML PHP SQL RDBMS Browser Web server ● "network is computer" – browser thin client ● Logic in controller, RDBMS & view (JavaScript) ● Trees (XML)? Self-referencing data?1970 ... 1975 ... 1980 ... 1985 ... 1990 ... 1995 .. 2000 ... 2005 ... 2010
    • 6/18 AJAX JSON REST Web2.0 View Controller Model HTTP HTML JSON JavaScript JSON JSON Browser 2.0 NoSQL server ● JSON without schema (or verification!) ● Logic in JavaScript on client and server ● Turtles all the way down reduces complexity1970 ... 1975 ... 1980 ... 1985 ... 1990 ... 1995 .. 2000 ... 2005 ... 2010
    • 7/18 Perfect web stack● HTTP REST API with JSON – GET, PUT/POST, DELETE● JavaScript queries using map/reduce – Real-world dirty data from views● Serve application from HTTP database (content-type support)● Two-way data binding forms <-> JSON – HTML is only template we need!● Single language: JavaScript (+jquery)● "simple app in single afternoon" benchmark
    • 8/18 CouchDB● Designed for replication over HTTP – applications replicatied with data (off-line)● Custom views, requests and _changes feed
    • 9/18 <angular/>● What if web browsers where written for web applications today? – html compiler inside browser – ng:repeat and friends to template objects – Objects persisted using REST to server● http://docs.angularjs.org/● Demos – http://angularjs.org/slides/intro/#/8 – printer overview – conference submission app
    • 10/18 angular-mojolicious● Mojolicious – web in the box (perl) – http://mojolicious.org/● Mojo::Client – chunked HTTP client – Perfrect for CouchDB integration● https://github.com/dpavlin/angular-mojolicious● REST API for Angulars $resource – CouchDB proxy or static JSON files● Replication with getangular.com service – not API compliant, uses newer version● Helpers to quickly prototype with angular
    • 11/18 Server-side templates● Generate slips server-side using angular – PhanotomJS – headless WebKit browser – http://www.phantomjs.org/ – https://github.com/dpavlin/angular-uplatnica$ ./bin/phantomjs examples/rasterize.js http://localhost:3000/app/index.html#/uplatnica uplatnica.pdf
    • 12/18Pixel-exact PDF templates?● Generate conference name tags – http://blog.rot13.org/2011/04/print-conference-name-tags-using-inkscape.html – Inkscape (SVG template) – pdfnup for to A4 page
    • 13/18 CouchDB triggers● Finite-state machine inside document● Multiple workers - FSM for lock and status● filter, trigger, commit on _changes feed● Perfect for async tasks – executing shell – sending e-mail
    • 14/18 CouchDB full-text search● Implemented as filter-only trigger● KinoSearch – full-text search, base for Apache lucy (Lucene in C)● trigger which delete/add documents – Unroll structures into.flat.schema● CouchDB external server to perform queries
    • 15/18 CouchDB related projects● BigCouch – https://github.com/cloudant/bigcouch – Consistant hashing, sharding● ElasticSearch – http://www.elasticsearch.com/ – CouchDB river● GeoCouch – https://github.com/vmx/couchdb – Spartial index
    • 16/18 Riak (search)● cluster of machines!● Amazons dynamo model – r,w – eventual consistency● Multiple map/reduce phases in single query – Ad-hoc, not cached, in parallel over cluster● post-commit hooks (search)● Links (REST traversal)● HTTP and ProcolBuffers interfaces● http://www.basho.com/riaksearch.html
    • 17/18 Alternative JSON storage● Raven DB – .Net platform – Linq Map/Reduce – RESTful JSON – http://ravendb.net/● PostgreSQL – Mostly tabular data? – hstore - key/value pairs – own HTTP/JSON app (ORM?) – http://www.postgresql.org/docs/9.0/static/hstore.html
    • 18/18 Overview● Avoid complexity – Model: JSON – View: HTML – Controller: angular● Solve offline problem: CouchDB – Attach async processes in the cloud!● Generate pdfs server side Attack interesting problems – Tree-data, (social) networks