8 ms·
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
by gord 15y ago
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 ]
- mmaunder 15y agoYeah and like HTML5 has totally replaced our web server.
- jemfinch 15y agoHe means a flat file of JSON records. Your sarcasm is unnecessary and uncharitable.
- deleted 15y ago[deleted]
- stfp 15y agoAND fun
- sausagefeet 15y agoHow do you know he means that?
- jemfinch 15y agoBecause 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.
- statictype 15y agoThe 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.
- daleharvey 15y agoLots of people use full blown rdbms's when they dont need to (see blogs), its not a silly point and the sarcasm was unwarranted
- alextingle 15y agoSarcasm is never unwarranted.
- code_duck 15y agoIf you can use SQLlite, you probably didn't need a real database. So the use cases overlap a bit with flat-files and JSON.
- mmaunder 15y agoThe 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 http://forge.mysql.com/wiki/MySQL_Internals_Algorithms
- code_duck 15y agoThe 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.
- awakeasleep 15y agoI 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.
- gord 15y agoI 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.
- tomjen3 15y agoI 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.
- kennystone 15y agoIt's pretty handy, and an easy upgrade to a 'real' database if the need ever arises - especially mongo/couch.
- yesimahuman 15y agoYou'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.
- gord 15y agoI 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!
- alextingle 15y agoBecause JSON is well known for its ACID compliance.