Apartment
fdb-record-layer
Apartment | fdb-record-layer | |
---|---|---|
5 | 4 | |
2,648 | 564 | |
0.4% | 0.4% | |
0.0 | 9.8 | |
2 months ago | 2 days ago | |
Ruby | Java | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Apartment
-
Figma's Databases team lived to tell the scale
I recall a popular rails gem[1] once upon a time that provided multi-tenancy via postgres schemas.
As it turns out, even the company the initially developed the gem ended up ditching the approach due to some of the issues you outlined above.
Managing separate schemas feels like one of those nefarious decisions that make things simple _initially_ but get you into a world of hurt when you need to scale. The company is since defunct but they have an article where they discuss why they ditched the approach [2], TL;DR it's too difficult to maintain and scale
[1] https://github.com/influitive/apartment#tenants-on-different...
-
Is there a way to have rails return a different set of data depending on the hostname?
Looks like you're trying to implement multi-tenancy. You might also want to look at the apartment gem.
-
Create views to display all data managed by apartment gem
One strategy of the apartment gem is to store tenant data in dedicated schemas in a Postgres database.
- restart rails app from controller action
-
How we found and fixed a rare race condition in our session handling - The GitHub Blog
The other issue I think was with Apartment tenant switching and ActiveRecord's column cache. Some tenants had the updated columns and others didn't. Also with Puma. People love them some Puma! Me, I go with Passenger. Well, if the requirements are right that is...
fdb-record-layer
-
Figma's Databases team lived to tell the scale
FoundationDB is really just a set of structures and tools to build any type of database you want on top of a solid foundation.
"FoundationDB decouples its data storage technology from its data model. FoundationDB’s core ordered key-value storage technology can be efficiently adapted and remapped to a broad array of rich data models. Using indexing as an example, FoundationDB’s core provides no indexing and never will. Instead, a layer provides indexing by storing two kinds of key-values, one for the data and one for the index."
https://apple.github.io/foundationdb/layer-concept.html
Then existing standard layers like the Record layer, providing "(very) roughly equivalent to a simple relational database" providing structured types, index, complex types, queries, etc.
https://github.com/FoundationDB/fdb-record-layer
-
FoundationDB: A Distributed Key-Value Store
> That being said, I wish there were more layers as the functionality out of the box is very very limited.
The record layer https://github.com/FoundationDB/fdb-record-layer which allows to store protobuf, and define the primary keys directly in those is truly amazing:
https://github.com/FoundationDB/fdb-record-layer/blob/main/d...
- FoundationDB: A Distributed Unbundled Transactional Key Value Store
-
Show HN: A strongly-typed document DB that runs on any transactional KV store
This looks really promising! Could you provide at a high-level what this aims to offer over FoundationDB's RecordLayer[1]?
[1] https://github.com/FoundationDB/fdb-record-layer
What are some alternatives?
Acts As Tennant - Easy multi-tenancy for Rails in a shared database setup.
foundationdb - FoundationDB - the open source, distributed, transactional key-value store
Milia - Easy multi-tenanting for Rails5 (or Rails4) + Devise
tigris - Tigris is an Open Source Serverless NoSQL Database and Search Platform.
activerecord-multi-tenant - Rails/ActiveRecord support for distributed multi-tenant databases like Postgres+Citus
hyhac - A HyperDex Haskell Client
rails_or - Cleaner syntax for writing OR Query in Rails 5, 6. And also add #or support to Rails 3 and 4.
deepr - A lightweight alternative to GraphQL
pluck_all - A more efficient way to get data from database. Like #pluck method but return array of hashes instead.
RefineDB - A strongly-typed document database that runs on any transactional key-value store.
SanitizeSqlLike - Backport #sanitize_sql_like method from Rails 4 for Rails 3. Sanitizes a string so that it is safe to use within an SQL LIKE statement.
TablaM - The practical relational programing language for data-oriented applications