News for hackers. Stuff that matters.
Re:Poll: What database does your company use? by thechangelog on Wednesday June 22, 2011 @03:53PM (#2684866)
SQLite all over the place – it's great having a super portable DB format for quick little hits.

There's nothing quite like sending a DB as an email attachment.

Re:Poll: What database does your company use? by SwellJoe on Wednesday June 22, 2011 @04:14PM (#2685008)
SQLite is so pervasive that I'm pretty sure everyone uses it at some point. It's in client applications, it's used by yum (the package manager found on CentOS/RHEL/Scientific Linux systems), it's part of many web applications, it's part of many spam filtering systems, it's part of Android (maybe iOS, too?), it's basically impossible to avoid it if you're a nerd.

Also, it's awesome.

Re:Poll: What database does your company use? by Skroob on Wednesday June 22, 2011 @04:29PM (#2685092)
SQLite is indeed built into iOS and Mac OS X as well. Core Data's store uses SQLite as an option (XML and Binary are the others), and it is accessible via third party frameworks like FMDB.
Re:Poll: What database does your company use? by enjo on Wednesday June 22, 2011 @04:42PM (#2685154)
It's also built into Android.
Re:Poll: What database does your company use? by sshumaker on Wednesday June 22, 2011 @09:49PM (#2686287)
Unfortunately, it's quite slow on Android. And make sure never to put your db on the sdcard, or else your whole phone becomes unusable while doing writes to the db.
Re:Poll: What database does your company use? by daliusd on Thursday June 23, 2011 @03:56AM (#2687088)
SQLite is overall slow if you are writing item-by-item. Does not matter what platform you use. Write multiple items in single transaction. As well understand what you get and what you loose by writing all items in single transaction.
Re:Poll: What database does your company use? by gaius on Thursday June 23, 2011 @06:35AM (#2687378)
And iPhones, and BlackBerries. It is by far the most widely use relational DB in the world (despite what the MySQL people claim on their website, they're not even close)
Re:Poll: What database does your company use? by shizcakes on Wednesday June 22, 2011 @05:54PM (#2685515)
Firefox uses it.
Re:Poll: What database does your company use? by nakkiel on Wednesday June 22, 2011 @11:06PM (#2686481)
So does Chrome. Actually, this comes in handy: http://sqlite.org/famous.html
Re:Poll: What database does your company use? by vijaydev on Thursday June 23, 2011 @03:06AM (#2686996)
So good to see Sun's logo there :)
Re:Poll: What database does your company use? by alextingle on Thursday June 23, 2011 @09:33AM (#2687758)
They should replace it with Oracle's logo now. Just for giggles.
Re:Poll: What database does your company use? by paulnelligan on Thursday June 23, 2011 @06:11AM (#2687336)
Ouch, Php got a mention, but they snubbed Rails, despite the fact that it comes bundled ... DHH won't like that one bit!
Re:Poll: What database does your company use? by StavrosK on Thursday June 23, 2011 @08:15AM (#2687558)
At this point, it would be faster for them to just list the companies who aren't using sqlite.
Re:Poll: What database does your company use? by bonzoesc on Thursday June 23, 2011 @09:33AM (#2687756)
Rails doesn't bundle sqlite3, just lists it as a default dependency for new projects.
Re:Poll: What database does your company use? by TheRealGL on Thursday June 23, 2011 @08:59AM (#2687660)
Probably couldn't use the Rails logo because of stupid trademarking, so they left it off.
Re:Poll: What database does your company use? by rwmj on Wednesday June 22, 2011 @06:20PM (#2685619)
Re:Poll: What database does your company use? by theanti9 on Wednesday June 22, 2011 @11:05PM (#2686479)
So does Chrome
Re:Poll: What database does your company use? by gord on Wednesday June 22, 2011 @04:37PM (#2685131)
For me JSON has replaced SQLLite, with a large reduction in code and complexity. [ Admittedly I've written my own routines to access it more simply/directly on iOS ]
Re:Poll: What database does your company use? by mmaunder on Wednesday June 22, 2011 @04:49PM (#2685190)
Yeah and like HTML5 has totally replaced our web server.
Re:Poll: What database does your company use? by jemfinch on Wednesday June 22, 2011 @05:29PM (#2685383)
He means a flat file of JSON records. Your sarcasm is unnecessary and uncharitable.
Re:Poll: What database does your company use? by statictype on Wednesday June 22, 2011 @09:58PM (#2686312)
The sarcasm was perhaps a little mean but he has a point. If a flat text file storing JSON could replace your database, then you probably never needed a DB in the first place.
Re:Poll: What database does your company use? by daleharvey on Wednesday June 22, 2011 @10:07PM (#2686330)
Lots of people use full blown rdbms's when they dont need to (see blogs), its not a silly point and the sarcasm was unwarranted
Re:Poll: What database does your company use? by alextingle on Thursday June 23, 2011 @09:34AM (#2687762)
Sarcasm is never unwarranted.
Re:Poll: What database does your company use? by code_duck on Thursday June 23, 2011 @12:01AM (#2686603)
If you can use SQLlite, you probably didn't need a real database. So the use cases overlap a bit with flat-files and JSON.
Re:Poll: What database does your company use? by mmaunder on Thursday June 23, 2011 @12:24AM (#2686649)
The JSON flat file sounds like variable length records where length is determined by parsing each record with global reader/writer locking?

It's like public storage where you have to sift through everyone else's crap to get to yours, every item is stored in a bulk cargo box and only one customer gets to store their stuff at a time.

If you're interested in db internals, here's a few algorithms that MySQL uses. Note this doesn't cover InnoDB which performs far better under high concurrency loads and offers row level locking, clustered indexes, an excellent caching algorithm, foreign key constraints with cascade, etc..etc...

http://forge.mysql.com/wiki/MySQL_Internals_Algorithms

Re:Poll: What database does your company use? by code_duck on Thursday June 23, 2011 @01:59AM (#2686844)
The way I've stored things in flat files is to make use of the file system's lookup capabilities. I wouldn't suggest storing data that may be requested or written to by more than one client at once with a method such as this, either. I wouldn't try to use it like a C array or anything. One file per user or more makes sense. I've also used stuff like this for system admin scripts.

Something like

   user_id=int(request.GET['id'])
   data_type=int(request.GET['id'])
   json_file="{0}-{1}-chart_data.json".format(user_id,data_type)
   #get the file, decode, etc.
It's a quick and dirty caching method that has good persistence, of course, is relatively performant under low loads and easy to understand.

Thanks, I'll check out the MySQL thing, but I'm not actually intending to build my own database.

Re:Poll: What database does your company use? by zem on Saturday June 25, 2011 @09:00AM (#2695562)
what's your cutoff line for something to be a "real database"? sqlite is fully acid compliant.
Re:Poll: What database does your company use? by code_duck on Sunday June 26, 2011 @11:14AM (#2698133)
sqlite is single user and locks a bit too frequently to be very scalable, so while quite useful, I mean sqlite not capable of fully replacing a typical engine such as postgres or mysql.
Re:Poll: What database does your company use? by sausagefeet on Wednesday June 22, 2011 @09:34PM (#2686238)
How do you know he means that?
Re:Poll: What database does your company use? by jemfinch on Friday June 24, 2011 @10:52AM (#2692421)
Because it's the only interpretation that makes sense, and charitable discussion demands that I assume my interlocutors are reasonable people who say things that make sense until I have evidence to the contrary.
Re:Poll: What database does your company use? by stfp on Wednesday June 22, 2011 @09:33PM (#2686233)
AND fun
Re:Poll: What database does your company use? by awakeasleep on Wednesday June 22, 2011 @08:19PM (#2686051)
I think you could make your point better by asking a question about the negative consequences/limitations of using JSON.

Sarcasm doesn't aid in making points online because people who don't know anything about the issue at hand make sarcastic 'points' as easily as an expert.

Re:Poll: What database does your company use? by gord on Thursday June 23, 2011 @07:54AM (#2687516)
I left it unsaid that I assumed SQLLite was normally used in places other than the traditional back end server data store - I tend to use postgreSQL / mysql or perhaps a noSQL variant such as couchDB/Mongo for server-side data.

So I meant that instead of using SQLLite on mobile devices, pc based local fat clients or in the browser... I now use JSON now whereas I might have used SQLLite before [ I also use JSON where I might have used XML or windows config files etc ]

I did not intend to say JSON is replacing MySQL / PostgreSQL.

Re:Poll: What database does your company use? by yesimahuman on Wednesday June 22, 2011 @10:45PM (#2686428)
You're getting jumped on, but you have a good point. It's often easier to just stringify a dictionary and read it back as the object instead of handling the database creation/insertion/selection if all you need is to store and access a few values.
Re:Poll: What database does your company use? by tomjen3 on Wednesday June 22, 2011 @06:51PM (#2685741)
I can sorta see many cases where that would be useful, but personally I am happy letting SQLLite do the heavy lifting extracting things with indexes, grouping and using the where clause.

But yeah, JSON is great for small amounts of data.

Re:Poll: What database does your company use? by gord on Thursday June 23, 2011 @08:08AM (#2687543)
I also tend to use JSON as the main messaging format for Client/Server communications [ where I might have used sockets custom binary protocol previously ].

This means I can reuse the same REST style data 'provider' from within a Javascript web UI and within an iOS or Android client app.

So theres quite a few reasons why using JSON simplifies things for me - particularly I notice that there is a whole layer or ORM style boilerplate code that I dont need now [ whether its SQLLite <-> Object or XML <--> Object ].

I actually like the SQL Lite implementation!

Re:Poll: What database does your company use? by kennystone on Wednesday June 22, 2011 @07:04PM (#2685791)
It's pretty handy, and an easy upgrade to a 'real' database if the need ever arises - especially mongo/couch.
Re:Poll: What database does your company use? by alextingle on Thursday June 23, 2011 @09:36AM (#2687772)
Because JSON is well known for its ACID compliance.
Re:Poll: What database does your company use? by michaelschade on Wednesday June 22, 2011 @04:21PM (#2685049)
Love SQLite when doing some Django development. Great to easily scrap the database with a quick `rm` and repopulate with good data.
Re:Poll: What database does your company use? by sc68cal on Wednesday June 22, 2011 @05:13PM (#2685311)
I've been breaking myself of that habit: I try and use the flush command so I don't have to keep doing the superuser creation step.

https://docs.djangoproject.com/en/dev/ref/django-admin/?from...

Re:Poll: What database does your company use? by michaelschade on Wednesday June 22, 2011 @05:32PM (#2685407)
Good point, as the superuser creation bit does tend to get annoying. But you have to admit–there's something much more fun about getting to rm your db ;)
Re:Poll: What database does your company use? by gusi on Wednesday June 22, 2011 @10:17PM (#2686358)
yeah, but if you are modifying the schema and are not using south or something like that, you will still want to rm & syncdb again....
Re:Poll: What database does your company use? by farktronix on Thursday June 23, 2011 @01:01PM (#2688641)
Agreed. SQLite also has a great copyright notice in its headers:

  ** The author disclaims copyright to this source code.  In place of
  ** a legal notice, here is a blessing:
  **
  **    May you do good and not evil.
  **    May you find forgiveness for yourself and forgive others.
  **    May you share freely, never taking more than you give.
(http://www.sqlite.org/src/artifact?name=a8571665d43ff18f89a4...)
Re:Poll: What database does your company use? by dorkitude on Wednesday June 22, 2011 @05:14PM (#2685322)
It's also worth noting that SQLite is, for the time being, the underlying store for Membase
Re:Poll: What database does your company use? by eipipuz on Wednesday June 22, 2011 @08:41PM (#2686106)
You mean the eventual persistance store.
Re:Poll: What database does your company use? by lukencode on Wednesday June 22, 2011 @07:01PM (#2685783)
In the microsoft world SQL CE 4 is pretty nice for doing the same sort of thing.
Re:Poll: What database does your company use? by josephcooney on Thursday June 23, 2011 @12:35AM (#2686683)
I still much prefer to use SQLite on the MS stack, given how reliable and ubiquitous it is.
Re:Poll: What database does your company use? by sharjeel on Thursday June 23, 2011 @05:35AM (#2687274)
In some scenarios I prefer Microsoft Excel over SQLite. Yes, Excel can be used as a database as well!
Re:Poll: What database does your company use? by arethuza on Thursday June 23, 2011 @07:48AM (#2687507)
Do you mean as a database engine using the ODBC driver for Excel or as a database-like application?
Re:Poll: What database does your company use? by chrisjsmith on Wednesday June 22, 2011 @04:20PM (#2685037)
Also damn useful when plugged into NHibernate for bringing up test cases using in memory databases for performance.