Showing posts with label nosql. Show all posts
Showing posts with label nosql. Show all posts

Wednesday, July 22, 2015

Vogels - DynamoDB data mapper for node.js

Check out vogels on github https://github.com/ryanfitz/vogels/


Features


You can configure vogels to automatically add createdAt and updatedAt timestamp attributes when saving and updating a model. updatedAt will only be set when updating a record and will not be set on initial creation of the model.
var Account = vogels.define('Account', {
  hashKey : 'email',

  // add the timestamp attributes (updatedAt, createdAt)
  timestamps : true,

  schema : {
    email : Joi.string().email(),
  }
});
If you want vogels to handle timestamps, but only want some of them, or want your timestamps to be called something else, you can override each attribute individually:
var Account = vogels.define('Account', {
  hashKey : 'email',

  // enable timestamps support
  timestamps : true,

  // I don't want createdAt
  createdAt: false,

  // I want updatedAt to actually be called updateTimestamp
  updatedAt: 'updateTimestamp'

  schema : {
    email : Joi.string().email(),
  }
});
You can override the table name the model will use.
var Event = vogels.define('Event', {
  hashkey : 'name',
  schema : {
    name : Joi.string(),
    total : Joi.number()
  },

  tableName: 'deviceEvents'
});
if you set the tableName to a function, vogels will use the result of the function as the active table to use. Useful for storing time series data.
var Event = vogels.define('Event', {
  hashkey : 'name',
  schema : {
    name : Joi.string(),
    total : Joi.number()
  },

  // store monthly event data
  tableName: function () {
    var d = new Date();
    return ['events', d.getFullYear(), d.getMonth() + 1].join('_');
  }
});

See more at examples https://github.com/ryanfitz/vogels/tree/master/examples
Read more at https://github.com/ryanfitz/vogels/

Wednesday, January 22, 2014

NoSQL vs. SQL Summary

SQL DatabasesNoSQL Databases
TypesOne type (SQL database) with minor variationsMany different types including key-value stores, document databases, wide-column stores, and graph databases
Development HistoryDeveloped in 1970s to deal with first wave of data storage applicationsDeveloped in 2000s to deal with limitations of SQL databases, particularly concerning scale, replication and unstructured data storage
ExamplesMySQL, Postgres, Oracle DatabaseMongoDB, Cassandra, HBase, Neo4j
Data Storage ModelIndividual records (e.g., "employees") are stored as rows in tables, with each column storing a specific piece of data about that record (e.g., "manager," "date hired," etc.), much like a spreadsheet. Separate data types are stored in separate tables, and then joined together when more complex queries are executed. For example, "offices" might be stored in one table, and "employees" in another. When a user wants to find the work address of an employee, the database engine joins the "employee" and "office" tables together to get all the information necessary.Varies based on database type. For example, key-value stores function similarly to SQL databases, but have only two columns ("key" and "value"), with more complex information sometimes stored within the "value" columns. Document databases do away with the table-and-row model altogether, storing all relevant data together in single "document" in JSON, XML, or another format, which can nest values hierarchically.
SchemasStructure and data types are fixed in advance. To store information about a new data item, the entire database must be altered, during which time the database must be taken offline.Typically dynamic. Records can add new information on the fly, and unlike SQL table rows, dissimilar data can be stored together as necessary. For some databases (e.g., wide-column stores), it is somewhat more challenging to add new fields dynamically.
ScalingVertically, meaning a single server must be made increasingly powerful in order to deal with increased demand. It is possible to spread SQL databases over many servers, but significant additional engineering is generally required.Horizontally, meaning that to add capacity, a database administrator can simply add more commodity servers or cloud instances. The database automatically spreads data across servers as necessary
Development ModelMix of open-source (e.g., Postgres, MySQL) and closed source (e.g., Oracle Database)Open-source
Supports TransactionsYes, updates can be configured to complete entirely or not at allIn certain circumstances and at certain levels (e.g., document level vs. database level)
Data ManipulationSpecific language using Select, Insert, and Update statements, e.g. SELECT fields FROM table WHERE…Through object-oriented APIs
ConsistencyCan be configured for strong consistencyDepends on product. Some provide strong consistency (e.g., MongoDB) whereas others offer eventual consistency (e.g., Cassandra)
http://www.mongodb.com/learn/nosql

Friday, February 22, 2013

Noqsl Meta - Cassandra, Mongodb, CouchDB, Redis,ElasticSearch, Kyoto Tycoon, Neo4j

Cassandra, Mongodb, CouchDB, Redis,ElasticSearch, Kyoto Tycoon, Neo4j yeteneklerine pek değinmeden genel bilgilerini karşılaştırmalı sunan bir tablodur. Bir performans karsilastirmasi degildir!

MongoDB 

Yazıldığı Dil: C++
Lisans: AGPL
Veri İletişim Protokolü: binary (BSON)
En iyi kullanım örneği :  Dinamik veri yapisi ihtiyaclarinizda. Surekli yeni diskler ve makinelerle genisletmeniz gerekecek derecede fazla buyuyen veriniz oldugunda.  CouchDb nin cabuk buyuen ve kolay kontrol edilebilen bir haline ihtiyac duydugunuzda.

Redis

Yazıldığı Dil: C/C++
Lisans: BSD
Veri İletişim Protokolü: Telnet-like
En iyi kullanım örneği :  Disk-backed in-memory database en onemli ozelligi. MongoDb orneginden oldugu gibi surekli artan verilerde degil ancak surekli ve sikca degisen verilerde kullanilmasi onerilir..

CouchDB

Yazıldığı Dil: Erlang
Lisans: Apache
Veri İletişim Protokolü: HTTP/REST
En iyi kullanım örneği :  Bi-directional (!) replication en onemli ozelligi. MongoDb de belirtigi gibi cok ve surekli buyuen datalar olmadiginda ama yine esnek bir data yapisi ve ayni zamanda versiyonlama çok önemli oldugunda.

Cassandra (1.2)

Yazıldığı Dil: Java
Lisans: Apache
Veri İletişim Protokolü: Thrift & custom binary CQL3

En iyi kullanım örneği :  Write/Read orani çok çok yuksekse ve yazma hizi onemliyse (mesela loglar). Java ile cok iyi hider

All nodes are similar, as opposed to Hadoop/HBase
Cross-datacenter replication
Querying by column, range of keys (Requires indices on anything that you want to search on)
Can be used as a distributed hash-table, with an "SQL-like" language, CQL (but no JOIN!)



Neo4j (V1.5M02)

Yazıldığı Dil: Java
Lisans: GPL, some features AGPL/commercial
Veri İletişim Protokolü: HTTP/REST (or embedding in Java)

En iyi kullanım örneği :  Graph islemlerinizde harika cozum sunar!
Full ACID
For searching routes in social relations, public transport links, road maps, or network topologies.

ElasticSearch 

Yazıldığı Dil: Java
Lisans: Apache
Veri İletişim Protokolü: JSON over HTTP (Plugins: Thrift, memcached)
Stores JSON documents

En iyi kullanım örneği :  Esnek dokumanlariniz ve gelismis arma ihtiyaclariniz oldugunda. fuzzy search ihtiyaci. Geodistance ihtiyaci oldugunda.

Kyoto Tycoon (0.9.56)

Yazıldığı Dil: C++
Lisans: GPL
Veri İletişim Protokolü: HTTP (TSV-RPC or REST)

En iyi kullanım örneği :  Memcache'e alternatif daha yetenekli bir seyler aradiginizda cozum olacaktir.

Hot backup, asynchronous replication (MongoDb'de de gelismis olarak olan bir ozellik.)
background snapshot of in-memory databases
Auto expiration (can be used as a cache server) (Redis'de de olan bir ozellik)



Thanks to Kristóf

Sunday, October 30, 2011

ZendCon 2011 Notları I, Learning CouchDB - Bradley Holt

İlgi çekici bir sunumdu. MongoDb varken CocuhDB kullanmaya başlayacağımı pek sanmıyorum [1] ancak yine de tanışmış olduk CouchDB ile.
Bradley Holt 1 saatlik sunumda [2] hem CouchDb'yi bizimle tanıştırdı hem de örnekler yaptı. Zaman kısa olduğundan kendi makinelerimize couchdb kurmaktansa http://www.iriscouch.com/ [3] üzerinden ücretsiz bir hesap açıp denemelerimizi oradan yaptık. Sunumdan aldığım notlar ile derlediğim ama henüz bitmemiş olan :) Türkçe sunumum aşağıda [4] :




1. Comparing MongoDB and CouchDB : http://www.mongodb.org/display/DOCS/Comparing+Mongo+DB+and+Couch+DB

2. Learning CouchDB - http://www.slideshare.net/bradley.holt/zendcon-2011-learning-couchdb

3. Iris Couch provides easy hosted CouchDB - http://www.iriscouch.com/

4. Sunuma doğrudan link : https://docs.google.com/presentation/pub?id=1xXQk0Jc8XqPHzO0sdb418U8OUgugFjYD0fhq-tTCbuQ&start=false&loop=false&delayms=15000