Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
SimpleBase is a lightweight JSON based serverless database with improved performance on key operations
The strength of document-oriented NoSQL database is their natural simplicity, but they are usually not very fast (unless they are serious server databases like MongoDB). SimpleBase solves performance issues in critical areas
It was written for situations where you need to organize a local database without a server with a JSON-oriented interface. But at the same time, increased performance requirements: for large collections (1000000+ documents in the collection), fast, almost instantaneous execution of some operations is required:
.. code-block:: Python
from pysimplebase import SimpleBase,DBSession
#creatig database db = SimpleBase("samples_db")
#inserting documents into collection id = db['goods'].insert({"name":"coffee", "price":15}) #insert one document print(db['goods'].get(id))
inserted = db['goods'].insert([{"name":"apple", "price":2},{"name":"apple", "price":3}]) #insert dataset
#insert or update (upsert) db['goods'].insert({"name":"coffee", "price":16,"_id":id},upsert=True) print(db['goods'].get(id))
#transaction with DBSession(db) as s: inserted = db['income'].insert({"product_id":id} , session=s) inserted = db['outgoing'].insert({"product_id":id} , session=s)
#updating db['goods'].update(inserted,{"updated":True}) print(db['goods'].all())
#simple search without index result = db['goods'].find({"name":"apple"})
#building complex queries result = db['goods'].find({"$and":[ {"price":{"$gt":1}}, {"price":{"$lte":10}} ]} ) print(result)
#hash indexes for unique values db['goods'].register_hash_index("hash_dynamic","name", dynamic=True) #there are dynamic and stored indexes db['goods'].reindex_hash("hash_dynamic") r = db['goods'].get_by_index(db["hash_dynamic"],"apple")
#text indexes db['goods'].register_text_index("fts","name", dynamic=True) #there are dynamic and stored indexes db['goods'].reindex_text("fts") r = db['goods'].search_text_index("appl")
#delete db['goods'].delete(id) db['goods'].delete(inserted)
#clear db['goods'].clear()
FAQs
High performance JSON-oriented database
We found that pysimplebase demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.