Miserlou/NoDB là dự án Data trên GitHub, viết chủ yếu bằng Python, với 385 sao. NoDB isn't a database.. but it sort of looks like one.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
NoDB isn't a database.. but it sort of looks like one!
NoDB an incredibly simple, Pythonic object store based on Amazon's S3 static file storage.
It's useful for prototyping, casual hacking, and (maybe) even low-traffic server-less backends for Zappa apps!
Features
Schema-less!
Server-less!
Uses S3 as a datastore.
Loads to native Python objects with cPickle
Can use JSON as a serialization format for untrusted data
Local filestore based caching
Cheap(ish)!
Fast(ish)! (Especially from Lambda)
Performance
Initial load test with Goad of 10,000 requests (500 concurrent) with a write and subsequent read of the same index showed an average time of 400ms. This should be more than acceptable for many applications, even those which don't have sparse data, although that is preferred.
Installation
NoDB can be installed easily via pip, like so:
$ pip install nodb
Warning!
NoDB is insecure by default! Do not use it for untrusted data before setting serializer to "json"!
Usage
NoDB is super easy to use!
You simply make a NoDB object, point it to your bucket and tell it what field you want to index on.
from nodb import NoDB
nodb = NoDB("my-s3-bucket")
nodb.index = "name"
After that, you can save and load literally anything you want, whenever you want!
# Save an object!
user = {"name": "Jeff", "age": 19}
nodb.save(user) # True
# Load our object!
user = nodb.load("Jeff")
print(user['age']) # 19
# Delete our object
nodb.delete("Jeff") # True
By default, you can save and load any Python object.
Here's the same example, but with a class. Note the import and configuration is the same!
class User(object):
name = None
age = None
def print_name(self):
print("Hi, I'm " + self.name + "!")
def __repr__(self):
""" show a human readable representation of this class """
return "<%s: %s (%s)>" % (self.__class__.__name__, self.name, self.age)
new_user = User()
new_user.name = "Jeff"
new_user.age = 19
nodb.save(new_user)
# True
jeff = nodb.load("Jeff")
jeff.print_name()
# Hi, I'm Jeff!
You can return a list of all objects using the .all() method.
Here's an example following from the code above, adding some extra users to the database and then listing all.
You can also pass in a default argument for non-existent values.
user = nodb.load("Jeff", default={}) # {}
Human Readable Indexes
By default, the indexes are hashed. If you want to be able to debug through the AWS console, set human_readable_indexes to True:
nodb.human_readable_indexes = True
Caching
You can enable local file caching, which will store previously retrieved values in the local rather than remote filestore.
nodb.cache = True
AWS settings override
You can override your AWS Profile information or boto3 session by passing either as a initial keyword argument.
nodb = NoDB(profile_name='my_aws_development_profile')
# or supply the session
session = boto3.Session(
aws_access_key_id=ACCESS_KEY,
aws_secret_access_key=SECRET_KEY,
aws_session_token=SESSION_TOKEN,
)
nodb = NoDB(session=session)
TODO (Maybe?)
Tests with Placebo
Local file storage
Quering ranges (numberic IDs only), etc.
Different serializers
Custom serializers
Multiple indexes
Compression
Bucket management
Pseudo-locking
Performance/load testing
Related Projects
Zappa - Python's server-less framework!
K.E.V. - a Python ORM for key-value stores based on Redis, S3, and a S3/Redis hybrid backend.
s3sqlite - An S3-backed database engine for Django
Contributing
This project is still young, so there is still plenty to be done. Contributions are more than welcome!
Please file tickets for discussion before submitting patches. Pull requests should target master and should leave NoDB in a "shippable" state if merged.
If you are adding a non-trivial amount of new code, please include a functioning test in your PR. For AWS calls, we use the placebo library, which you can learn to use in their README. The test suite will be run by Travis CI once you open a pull request.
Please include the GitHub issue or pull request URL that has discussion related to your changes as a comment in the code (example). This greatly helps for project maintainability, as it allows us to trace back use cases and explain decision making.
Miserlou/NoDB có 385 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/Miserlou/NoDB. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
Miserlou/NoDB có những chủ đề gì?
GitHub topics của Miserlou/NoDB: "aws", "json", "lambda", "nodb", "nosql", "python", "s3", "serverless", "zappa". TopGit xếp repo vào nhóm Data.
Miserlou/NoDB còn đang phát triển không?
Commit gần nhất trên Miserlou/NoDB là 6.3 năm trước (theo timestamp GitHub). Repo có 45 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Miserlou/NoDB là gì?
Miserlou/NoDB (Miserlou/NoDB) là dự án Python trên GitHub. Theo mô tả gốc: NoDB isn't a database.. but it sort of looks like one.
Miserlou/NoDB so với các dự án Data khác thế nào?
Miserlou/NoDB được TopGit xếp vào nhóm Data, với 385 sao GitHub và viết bằng Python. Xem trang chủ đề Data trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Miserlou/NoDB viết bằng ngôn ngữ gì?
Miserlou/NoDB chủ yếu viết bằng Python. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Vì sao Miserlou/NoDB được xếp vào nhóm Data?
TopGit xếp Miserlou/NoDB vào nhóm Data dựa trên GitHub topics và mô tả của repo (gắn thẻ: "aws", "json", "lambda"). Việc phân loại dựa trên metadata thật của repo, không phải đoán theo cảm tính biên tập.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về NoDB?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về NoDB.