5 ms·
Show HN: SleekDB – A NoSQL Database made using PHP
- deleted 6y ago[deleted]
- yagodragon 6y agoI love it! I like how it's just pure php and purposefully built for small size I/O needs. The documentation also looks great, so I might actually give it a try. Has anyone used it? On a side note, for small projects everyone preaches about serverless js functions and firebase, but a can't imagine how sleekdb + a micro framework like slim + modern php 8 is actually bad
- rakibtg 6y agoGlad you liked it! Totally agree with you on that! Yes, I am using it in production for a company. Few are just landing pages with simple admin interface to update data on the fly.
- psoots 6y agoI'm very skeptical of this. It doesn't seem like something that could scale. By accessing database files through PHP, you are begging for race conditions while serving multiple requests simultaneously. At best, you will hit write-errors while other requests are working with the file. SQLite has a good explanation of the problem here: https://sqlite.org/faq.html#q5 https://sqlite.org/faq.html#q5
- rakibtg 6y agoYou are correct, it is suitable for small-medium traffic websites with less write operations and more read operations. We have a simple file locking mechanism to handle this situation. The caching part makes it a static storage by combining multiple files per query.
- duhi88 6y agoSeems great for blogs and marketing sites, especially if you've got a CDN in front.
- offtop5 6y agoGood work, looks like it's built primarily for prototyping so you don't need to spin up a separate mongodb. Any migration tools for when you need to switch the production
- dubcanada 6y ago@rakibtg - not sure if it's just me (Windows, Chrome) but if I scroll down manually and then click any of the links on the left I end up in the middle of the section, rather then at the top. So go to the site, scroll down a little using the scrollbar, click "Delete Data" on the left. You are now in the middle of the "Delete Data" section. Looks like you show/hide different sections, you should scroll to the top of the section on click. Besides that it seems rather great, I am going to test it out.
- rakibtg 6y agoThank you so much! Will fix it soon :)
- lioeters 6y agoNicely done! I like the small codebase with no dependencies - I imagine it's easy to start using. Also appreciate the extensive query interface and documentation. It reminds me of NeDB in Node.js world, which has proven its worth to me on several occasions when I needed a simple JSON-based database for a small(ish) audience, with mostly read operations (which are served from memory). They're running for literally years with no issue at all. https://github.com/louischatriot/nedb https://github.com/louischatriot/nedb
- solarteken2001 6y agoFantastic! I will give it a try asap but it looks super easy to get started and the documentation is brilliant. Amazing work! Regarding security, could you please elaborate how sensitive data can be stored (and protected)?
- rakibtg 6y agoIf you want to store password then use php password_hash function, otherwise all the data will be stored as plaintext JSON files. We don't have any data encryption implemented yet.
- yawnxyz 6y agothat's super cool! What are everyone's thoughts on using php for this vs. something like airtable as a db for prototyping? I've been running everything off of Airtable for a while and it's working really well, and my cofounder can work straight in the interface with no problems. (It's aggressively cached, runs several serverless sites, and I know it doesn't scale, but I'm setup to move to Postgres if I need to, but so far I haven't...)
- rakibtg 6y agoThat is really cool! Join our discord and we can discuss about it more!
- dmje 6y agoLooks ace, will try it out!
- nodesocket 6y agoSomewhat related. I wrote a very very simple tool called JSONlite (https://github.com/nodesocket/jsonlite https://github.com/nodesocket/jsonlite) which is pure bash and stores JSON in flat files. It does not support nested querying, or querying really of any sort besides the primary id. So, it technically is more of a K/V.
- Scarbutt 6y agoOr just use sqlite
- didijudo 6y agoMaybe I’ll create my website using it!!
- rakibtg 6y agoGreat! Please let us know the site you are going to build :)
- eyelidlessness 6y agoI built something like this in the run up to my first major engineering job. I embraced NoSQL after for a while. But ultimately types won, and then tools that work with them. If you are using this or something like it I strongly encourage connecting your type system to it with common JSON Schema tools so it at least lets the rest of your tools find out what your data model is, even if you haven’t defined it