Coder Social home page Coder Social logo

meteor-grounddb's Introduction

Ground DB

GroundDB is a fast and thin layer providing Meteor offline database and methods

##Creating a GroundDB object

  var list = new GroundDB('list');

Live basic test

##Features:

  • Ligth footprint
  • Broad browser support Chrome, Safari, Firefox
  • Fallback to normal Meteor.Collection
  • Resume of changes in collections
  • Resume of methods
  • Works offline cross window tabs

##Support Tested on Chrome, Safari, Firefox - but all browsers that support localstorage contains a FF safe test of localstorage If localstorage is not supported the groundDB would simply work as a normal Meteor.Collection

##Meteor Collection Interface GroundDB is like a normal Meteor.Collection - but changes and outstanding methods are cached and resumed.

##Concept Localstorage is simple and widely supported - but slow

GroundDB saves outstanding methods and minimongo db into localstorage - The number of saves is minimized. It's less than a save pr. change

When the app loads GroundDB resumes methods and database changes - made when offline and browser closed.

##Options It's possible to mount an allready existing collection on a groundDB eg.:

  Meteor.users = new GroundDB('users', {
    collection: Meteor.users
  });

The example will keep Meteor.user() returning correct user details - Supports smartCollections by this option too

##Security GroundDB works just like a normal Meteor.Collection why allow and deny still works.

##Resume of outstanding methods Database changes and methods will be sent to the server just like normal. The methods are sent to server after relogin - this way this.userId isset when running on the server. In other words: Just like normal

##Future

  • At the moment the conflict resolution is pretty basic last change recieved by server wins. This could be greatly improved by adding a proper conflict handler. For more details look at comment in server.js
  • Havent tested it on IE

##Contributions Feel free to send issues, pull requests all is wellcome

Kind regards Morten

meteor-grounddb's People

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.