The Philippine Online Chronicles

Thursday
Sep 02
Home Features Lintech! Today in Sci & Tech Drooling over databases: SQLite, PosgtreSQL, and CouchDB

Drooling over databases: SQLite, PosgtreSQL, and CouchDB

I'm pretty excited about this article because I'm a database fanatic / addict. For those who don't know what a database is, simply put, a database is where your data is stored and defined (whether by a schema or by documents). You use databases everyday as long as you use a computer, a cellphone, or even a website. And for the past weeks, we've seen awesome news from the open source database systems community, which means we will have upgrades on how we use our databases. I'll start off with something very new and fresh.

 

CouchDB celebrates v1.0 release

For a database guru, CouchDB might be a hobbyist of a database system. This is because CouchDB is one of the new kids in town, calling themselves NoSQL, boasting speed and ease of development for your company's resident geeks. I was actually in the middle of doing research to revive an application I considered my baby and, this may sound foreign to some people, create a backend system that would help me automate updates and messages across multiple machines. Since I was a one-man development department in that team that time, I asked for a month of research so that I could architect and develop a system that's highly-scalable, meaning that it could host tons of requests, while, at the same time, being super simple. I came across CouchDB and thought maybe this is all I'd need to accomplish the task.

What actually interested me is CouchDB's ability to replicate and store history of data stored inside it, and the bells and whistles that their notifications system could do. The first thing that crossed my mind that I could develop on a technology like this was a communication system that could do online / offline modes and synchronize across different devices... perfect for local disaster management and coordination. Of course, the possibilities are endless with its webby style of making an application - whether web, mobile or desktop – communicate with the database (CouchDB uses JSON and HTTP for this) and its event-driven data replication.

Even though CouchDB has already been used by big companies like the media company BBC, web-based chat client Meebo, scientific research firm Assay Depot, and even POC's parent organization Vibal Foundation, the only thing that bothers users is its lack of a production-level release. Luckily, just yesterday, the CouchDB team release version 1.0, which boasts a 3x performance gain over the previous stable version, 0.11. There is also a simultaneous release for 0.11.1, an update to the latest stable version which includes GZIP encoding for attachments (CouchDB recommends storing files in them which is totally unrecommended in normal SQL servers) and faster buildup of views, which are a means to present data depending on query conditions.

For those who want to learn more about CouchDB, just go to their official website or read their free online book.

 

PosgtreSQL goes Cloud 9

Nope, PostgreSQL isn't turning into a NoSQL cloud solution of some sort. PostgreSQL is aiming for version 9 release this year and promises a ton of improvements which includes: (1) the much-awaited hot-standby feature, which enables an enterprise database system in a machine to speedily switch to read-only mode via another database machine and do maintenance on them without making the database seem offline; (2) and the most-requested streaming replication, for it is rare for SQL database solutions to include with them out-of-the-box streaming data replication across multiple database machines.

PostgreSQL has long been tagged as an open source alternative for Oracle, the world's biggest commercial database system, and a more enterprising alternative to MySQL, the world's most popular relational database system. Previous versions have been tested against these big database systems and found lacking in features (compared to Oracle) and high performance (compared to MySQL), but PostgreSQL's latest stable release has recently caught up with MySQL in terms of RAM usage and CPU utilization.

My first personal database favorite is actually PostgreSQL and I even used it for my senior project, but I also experienced the pains of setting it up and making it work the way MySQL should work. Further development on top of the database system made me aware of database concepts like replication, sharding and text indexing via tools like the now-built-in Slony-I, PGPool, and Tsearch2. It was my teacher since it's like the poor man's Oracle DBMS, but not really that cheap a solution. It has been used by Skype and social networking player Hi5.


SQLite goes heavy on concurrency

On the upcoming SQLite release this July 22, SQLite promised to add in to their list of features the ability to handle concurrent requests (requests at-the-same-time) via their Write-Ahead Logging implementation. SQLite has been the database system for desktop and mobile applications and it has been long used by giants like Apple, Oracle, and even Microsoft. If you own a Mac and a licensed copy of the iLife, most probably you're using SQLite yourself. SQLite is also the core of Firefox's ability to save application data in a more structured and speedy-search way, that's why it has also been used by other browsers for the upcoming HTML5 plus-feature of offline database storage. This means that in HTML5 – which has already been implemented by Opera, Apple's Safari, Google's Chrome, Mozilla's Firefox, and Microsoft's Internet Explorer 9 – you will have the ability to store data to keep your web experience seamless and uninterrupted even if users get disconnected from the internet.

I remember being very active in the SQLite mailing list and I even created my own lightweight wrapper for Objective-C development. In plain English, it means I was developing for the Mac before and the reason I created this “wrapper” is because I personally wanted to have an uber-lightweight set of libraries or tools to be used for coding in the Mac without translating my messages everytime I communicate with SQLite's libraries. SQLite is very powerful, in which you could use the system with your own file format and still search like a pro within that file. Regular file formats like XML or simple text would be very cumbersome to search and if they grow to a few hundred megabytes, the library that utilizes those files will drag the application down, causing major slowdowns in the database. One of the file formats that are optimized for searching is Microsoft Outlook's PST file format. They could grow up to gigabytes and still not drag down your MS Outlook experience, assuming your mail application didn't catch a virus or a malware.

--

CouchDB Logo used under fair use.



Add this page to your favorite Social Bookmarking websites
Digg! Reddit! Del.icio.us! Google! Live! Facebook! StumbleUpon! Newsvine! TwitThis
 
Comments
Add New RSS

Disclaimer: Comments posted here reflect our readers’ views and not the opinion of The Philippine Online Chronicles.

Migs 16 July 10, 09:25 AM
Hi Jopes,

Interesting write up you have here about couchdb. It made me look into it deeper, and I'm thinking it may have a few places in our system that I can implement them on. Right now, I'm elbow deep into postgres, but the requirements are more like fitting square pegs into round holes.

Anyway, can you recommend any other resources for studying couchdb? Thanks!
Jofell Gallardo 21 July 10, 10:19 AM
That's pretty awesome news dude! I'd love to help if you need any.

As for your question, I have a few pages from the CouchDB Wiki Site I frequently visit...

http://wiki.apache.org/couchdb/HTTP_Document_API
http://wiki.apache.org/couchdb/Built-In_Reduce_Functions
http://wiki.apache.org/couchdb/Introduction_to_CouchDB_views
http://wiki.apache.org/couchdb/HTTP_Bulk_Document_API

They provide a wider perspective of the basic CouchDB APIs and convenience techniques...
Alex Popescu 21 July 10, 05:02 AM
Migs, you'll hopefully find some good materials in the NoSQL focused blog myNoSQL: http://nosql.mypopescu.com . You can use the couchdb tag for reading only about CouchDB, but I'm pretty sure some of the other NoSQL database will get your attention too.
Jofell Gallardo 21 July 10, 10:24 AM
Hi Sir Alex. Actually it's not only CouchDB I'm looking forward to using... I'm thinking of applying neo4j for graph-based data, as well as try out Cassandra or Solr. I have to say I'm not a fan of MongoDB, but that's just me (I have my own reasons) and I think MongoDB has already resolved the performance issues most SQL solutions encounter... they just have to fix a lot of durability issues that's been circulating around the webs... pretty scary stuff for me.
Write comment
Name:
Email:
 
Title:
Please input the anti-spam code that you can read in the image.

!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."

Share on facebook

Lintech Videos


Get the Flash Player to see this player.
Disclaimer