{"id":23924522,"url":"https://github.com/dbpprt/filebiggy","last_synced_at":"2025-04-12T02:26:01.685Z","repository":{"id":79098690,"uuid":"23354656","full_name":"dbpprt/filebiggy","owner":"dbpprt","description":"FileStore-only version of rob conery's biggy","archived":false,"fork":false,"pushed_at":"2014-09-09T20:59:39.000Z","size":261,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T02:25:57.059Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbpprt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-26T14:30:44.000Z","updated_at":"2022-12-09T07:53:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"4fa0349d-49e1-4040-ae1e-993c318a82c9","html_url":"https://github.com/dbpprt/filebiggy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbpprt%2Ffilebiggy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbpprt%2Ffilebiggy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbpprt%2Ffilebiggy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbpprt%2Ffilebiggy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbpprt","download_url":"https://codeload.github.com/dbpprt/filebiggy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248506481,"owners_count":21115435,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-05T19:15:09.104Z","updated_at":"2025-04-12T02:26:01.660Z","avatar_url":"https://github.com/dbpprt.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# This project has been discontinued\n# I'm moving to a new project [MobileDB](https://github.com/flumbee/mobiledb \"MobileDB\")\n\n## FileBiggy: A simple document store with json, bson, and in memory stores\n\nI looked for a small embedded database for a small website. I dont want to setup a full database engine just to store some megabytes of data. So i found Rob Connery's biggy which covers my aspects. But biggy implements alot of other features which i dont need, like psql, mongo, etc. So i created FileBiggy which is just a document database with a file storage. \n\nFileBiggy ships a BiggyContext, which is an entityframework inspired data context. Just define some entities, a context and it works.\n\nFileBiggy supports a JsonStorage, a BsonStorage (good to store files in a managed manner), and a simple in memory store for unit testing.\n\nData is loaded into memory when your application starts, and you query it with Linq. That's it. It loads incredibly fast (100,000 records in about 1 second) and from there will sync your in-memory list with whatever store you choose. \n\n## Getting started\n\nLet's say you want to store some movies in your database so define a movie entity\n\n```csharp\npublic class Movie\n{\n    [Identity]\n    public string MovieId { get; set; }\n\n    public string Name { get; set; }\n\n    public string[] Genres { get; set; }\n\n    public int Year { get; set; }\n\n    // and some other properties\n}\n```\n\nThe next step is to define your context.\n\n```csharp\npublic class MovieContext : BiggyContext\n{\n    public MovieContext(string connectionString)\n        : base(connectionString)\n    {\n    }\n\n    public EntitySet\u003cMovie\u003e Movies { get; set; }\n}\n```\n\nAnd that's it. Context classes should be stored as singleton instances, because they keep the data synchronized in memory.\nFileBiggy has a simple fluent api to obtain a context instance:\n\n```csharp\nvar jsonContext = ContextFactory.Create\u003cMovieContext\u003e()\n    .AsJsonDatabase()\n    .WithDatabaseDirectory(\"C:\\\\mydatabase\")\n    .Build();\n\n// this wont work. you need to change Movie's identity from string to Guid\nvar bsonContext = ContextFactory.Create\u003cMovieContext\u003e()\n    .AsBsonDatabase()\n    .WithDatabaseDirectory(\"C:\\\\mydatabase\")\n    .Build();\n\nvar memoryContext = ContextFactory.Create\u003cMovieContext\u003e()\n    .AsInMemoryDatabase()\n    .Build();\n```\n\nLet's add some stuff to our created database:\n\n```csharp\nvar movies = jsonContext.Movies;\nvar theSameMovies = jsonContext.Set\u003cMovie\u003e();\n\n// or movies.AddAsync in a async application :)\nmovies.Add(new Movie\n{\n    Genres = new[] { \"Action\" },\n    MovieId = \"tt0468569\",\n    Name = \"The Dark Knight\",\n    Year = 2008\n});\n\nvar darkKnight = movies.Where(movie =\u003e movie.Name.Contains(\"Dark\"));\n```\n\n## Features\n\n- Full Async/Await support (new!)\n- EntitySets are threadsafe (had some problems with biggy's non-threadsafe singleton instances)\n- Dynamic data scheme\n- IdentityAttribute marks a key, and gives you really fast access to these entities\n- Less dependencies and a small assembly (about 35kB)\n- Entityframework like datacontext which is nice for IoC uses (i'll add a sample solution)\n- Clear interfaces and good capabilities to add your own fancy Store\n\n\n## Limitations\n\n- each BiggyContext must contain only one EntitySet per type\n- BsonStore requires a Guid Identity\n- BsonStore isnt really optimized at the moment but quite good for storing files\n\n## How to install\n\nJust grab the FileBiggy package from nuget and install it\n\n```\nInstall-Package FileBiggy\n```\n\n## Roadmap\n\n- add builds for other platfroms (phone, xamarin, etc)\n- add some other usefull attributes [Expires], [ForeignIdentity]\n- add some sample projects\n- the issues for more informations\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbpprt%2Ffilebiggy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbpprt%2Ffilebiggy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbpprt%2Ffilebiggy/lists"}