2015年6月2日 星期二

MemSQL vs. MongoDB

MemSQL MongoDB
CategoryDatabaseDatabase, Data Storage
Preference75% votesvotes25% votesvotes
Websitewww.​memsql.​comwww.​mongodb.​org
LicenseProprietaryAGPLv3
Design
Database modelRelational, Distributed data structureDocument-oriented, Schema-less, NoSQL
Data storageVolatile memory, File SystemVolatile memory, File System
EmbeddableYesYes
Features
Query languageSQLAPI calls, JavaScript, REST
Data typesAll MySQL, JSON, BLOBJSON
Conditional entry updatesYesYes
Map and reduceYesYes
UnicodeYesYes
TTL for entriesNoYes
CompressionYesYes
Integrity
Integrity modelACID, MVCCBASE
AtomicityYesConditional
ConsistencyYesYes
IsolationYesYes
Durability (data storage)YesYes
TransactionsYesNo
Referential integrityYesNo
Revision controlYesNo
Locking modelLock Free Model, MVCCOptimistic Locking, Lock on write
Indexing
Secondary IndexesYesYes
Composite keysYesYes
Full text searchNoYes
Geospatial IndexesYesYes
Graph supportNoNo
Graph typeOriented graph?
Distribution
Horizontal scalableYesYes
ReplicationYesYes
Replication modeMaster-Slave ReplicationMaster-Slave-Replica Replication
ShardingYesYes
Shared nothing architectureYesYes
Restrictions
Value size max.1 000 EB16 MB
System requirements
Operating systemLinux, Amazon EC2Linux, Windows, Mac OS X
Native driverC, C++, php, Java, Python, Objective-C, Ruby, GoJava, php, Ruby, C#, Python, JavaScript, Haskell, Perl, C++, Erlang, Scala, C, Go
Memory recommended8 GB?
Memory minimum8 GB?
Architecture
Programming languageC++C++
More
DescriptionIn-Memory Database used for real-time analytics.Document Oriented Database
Multi-user systemYesYes
Accelerometer sensorNo?
Price rating●●●○○●●●●●
Software distributionPackage management systemTarball, Ubuntu Software Center, Package management system, Windows Installer
Object-Relational Mapping (ORM)YesYes
Release Date18ᵗʰ June 2012March 2009
Documentation level●●●●○●●●●●
Distributed CounterYes?
Free to useYesYes
ActiveYesYes
Database Connection PoolingYesYes
Real time analyticsYesYes
2 Letter Country CodeUS?
Cloud platform supportAmazon EC2Heroku, CloudBee, Bluemix, Amazon EC2, SoftLayer
Online backupYesYes
Function Based IndexYesNo
LogYesYes
Downloadwww.​memsql.​com/​#downloadmongodb.​org/​downloads
Backup functionalityGoodGood
Query CacheYesYes
Ease of use●●●●○●●●●●
Free for commercial useNoYes
SortsYesYes
Perfomance●●●●○●●●●○
Materialized ViewsNoNo
Spring Data SupportYesYes
JSONYesYes
Stored ProcedureNoYes
ConcurrencyYes?
Multi-statement TransactionsYesYes
ColumnerYes?
Brand?MongoDB Inc
Extension/Plug-in?Yes
Database?MongoDB
Standard compliance?No
RESTful?Conditional
Lines of code?617 k
Community Driven?Good
Web interface?Yes
Data encryption?Conditional
Admin Generator?Yes
Partial Index?No
Key length max?128
Implementation flexibility(0% global votes)(48% global votes)
In-Place Update?Yes
Capped Collections?Yes
Tuneable write concerns?Yes
Read preferences?Yes
Open Source?Yes
Op/s?5 000
Triggers?No
Pause Test?Yes
Cross Domain Testing?No
Pipeline Aggregation?Yes
Geospatial?Yes
Server Side Java Script?Yes
Flexible Table(Schema)?Yes
Geo-distributed?Yes
Max rows in query result?1 000
Re-Reduce?Yes
Clustering over WAN?Yes
Fully Distributed?Yes
Auto-Sharding?Yes
memcached protocol?No
Monitoring UI?Yes
Recursive queries?No
Network datatype?No
Windowed aggregate?No
CLI`?Yes
This table is based on the vsChart comparison MemSQL vs. MongoDB comparison | vsChart.com, which is released under the Creative Commons Attribution-Share-Alike License 3.0.

2014年9月23日 星期二

Linux 圖片轉檔指令

convert beach.gif beach.pnm


NAME
convert - convert an image or sequence of images

SYNOPSIS
convert [ options ... ] input_file output_file

DESCRIPTION
Convert converts an input file using one image format to an output file with a differing image format. In addition, various types of image processing can be performed on the converted image during the conversion process. Convert recognizes the image formats listed in ImageMagick.

2014年9月18日 星期四

Install Flask on CentOS 7.0

1. Install pip on CentOS 7.0

## First install the EPEL repo as per your Operating system version and architecture.
rpm -ivh http://mirror01.idc.hinet.net/EPEL/7/x86_64/e/epel-release-7-1.noarch.rpm
yum install -y python-pip

2. Install Flask

pip install Flask

## Test
vi hello.py

from flask import Flaskapp = Flask(__name__)
@app.route("/")def hello():    return "Hello World!"
if __name__ == "__main__":    app.run()

## Verify
python hello.py

* Running on http://0.0.0.0:80/

2014年7月17日 星期四

Python: ConfigParser

[core]
cmd = /usr/bin/vim

[mod]
safe_edit = yes
time_interval = 20

python 程式如下:
#!/usr/bin/python
from ConfigParser import SafeConfigParser
parser = SafeConfigParser()
parser.read('test.conf')

#傳回字串 /usr/bin/vim
parser.get('core', 'cmd')

#傳回 boolean 值 True
parser.getboolean('mod', 'safe_edit')

#傳回整數值 20
parser.getint('mod', 'time_interval')


references:
http://williewu.blogspot.tw/2007/10/python-configparser.html
https://wiki.python.org/moin/ConfigParserExamples
https://docs.python.org/2.6/library/configparser.html