title: JSON-based database system
body: <p>I am building a web based chat application using Node.js. I am kinda building it gradually while the app is already running in a Node.js PaaS and being tested by my bunch of friends. The thing is, I can't spend much money on database services to store chat history.</p>
  
  <p>So I am designing a sophisticated file-based database system just like SQLite. Although I am aware that SQLite does similar job, I wanted to store data in a JSON format. The reasons are many. One notable reason is, to reduce CPU usage, I will just send raw JSON data to clients where they will be rendered properly using AngualarJS.</p>
  
  <p>My questions are:</p>
  
  <ol>
  <li>What are your opinions about this method?</li>
  <li>Is this method both vertically and horizontally scalable?</li>
  <li>What are the possible security issues?</li>
  <li>Is there any alternate method available?</li>
  </ol>
  
  <p>Please note that this solution is only for trivial data storage like chat history. I am not gonna use this method for a large and serious web applications. </p>
  
  <p><strong>Update:</strong>
  I don't want to use MongoDB or others since I cannot afford them for this project. I want to store data in a flat-file and place it in a disk. Because, many PaaS providers give 1GB of disk space at just $1 whereas 1GB of MongoDB storage is very high... also they even bill us for the amount of data transferred, number of PUTs and GETs etc.</p>