hit counter

Timeline

My development logbook

Different Type of Database Models

I find this summary in Eric Redmond’s ‘A Little Riak’ book very concise and useful.

  1. Relational Traditional databases usually use SQL to model and query data. They are useful for data which can be stored in a highly structured schema, yet require lexible querying. Scaling a relational database (RDBMS) traditionally occurs by more powerful hardware (vertical growth).

    Examples: PostgreSQL, MySQL, Oracle

  2. Graph These exist for dataighly interconnected data. They excel in modeling complex relationships between nodes, and many implementations can handle multiple billions of nodes and relationships (or edges and vertices). I tend to include triplestores and object DBs as specialized variants.

    Examples: Neo4j, Graphbase, IniniteGraph

  3. Document Document datastores model hierarchical values called documents, represented in formats such as JSON or XML, and do not enforce a document schema. They generally support distributing across multiple servers (horizontal growth).

    Examples: CouchDB, MongoDB, Couchbase

  4. Columnar Popularized by Google’s BigTable, this form of database exists to scale across mul- tiple servers, and groups similar data into column families. Column values can be individually versioned and managed, though families are deined in advance, not unlike RDBMS schemas.

    Examples: HBase, Cassandra, BigTable 4

  5. Key/Value Key/Value, or KV stores, are conceptually like hashtables, where values are stored and accessed by an immutable key. They range from single-server varieties like Memcached used for high-speed caching, to multi-datacenter distributed systems like Riak Enterprise.

    Examples: Riak, Redis, Voldemort

Concurrency and Parallelism

One of the misconceptions about concurrency is people often confuse concurrency and parallelism. Concurrency is a programming model that lets you express things that are independent, as independent executions and parallelism is about running two things at the same time. They are not the same idea and a lot of people confuse them, they think they are the same thing, but concurrency and parallelism are best thought of as a different idea. You can write beautiful concurrent programs with no parallelism whatsoever and you can also write extremely parallel programs that are not remotely concurrent. Concurrency is a model, parallelism is a result – maybe that’s the best way to say it.

- Rob Pike

Source: Infoq

MFA

You can simply refer a Module/Function/Argument tuple as MFA

Global:send_message

! (‘bang’) should not be used to call a globally registered name. Instead, you should use global:send

A bit disappointed when I first learn about this: didn’t I come to erlang for the bang operator? Now you take it away from me, global module.

Pong and Pang in Erlang

I know it is quite clever to use ‘pang’ to indciate the process does not exist. However both responses (‘pong’ and ‘pang’) just look too similar to each other if the terminal app uses a certain kind of font. Don’t think i would enjoy it under stress in an operation/support situation.

1
2
3
4
> net_adm:ping(exist@server).
pong
> net_adm:ping(notexist@server).
pang