Some comments after some usage of redb #12
Replies: 4 comments 22 replies
|
Thanks for the detailed feedback. Some of it (interceptors, CancellationToken) was already on the 4.0 roadmap, and your write-up moved it to the front of the queue: both are in the tree now. The rest turned out to be diagnostics or documentation defects, and we fixed those right away. Point by point:
Everything above is already in the tree and will ship with 4.0.0 (not released yet, coming soon). |
|
Good questions, all three. In order: 1. Audit records in the same transaction: yes, and the recipe is one line. By default the hooks deliberately do not share the save's transaction. await redb.Context.ExecuteAtomicAsync(async () =>
{
await redb.SaveAsync(obj); // the whole pipeline, SavedAsync included, runs inside this transaction
});Inside that scope an insert from 2. On the 3. Thanks again for pushing on the details: two of your three follow-ups turned into shipped improvements (the atomicity recipe is now spelled out in the interceptor docs, and E205 exists because of this thread). |
|
4.0.0 is out, so here is what each of your six points turned into. Everything below is on nuget.org now. 1. CancellationToken. Shipped as described: a trailing 2. Debugger and ToString. 3 and 4. Impersonation and richer audit. 5. Soft delete. The name stays, and the documentation now leads with what the method actually is: an instant atomic mark, a background batched purge, unique keys released on the spot. The recoverable bin remains a different pattern, your own trash container built from ordinary tree operations. 6. Bare E205 is in Two things worth knowing beyond your list. Pro is free on the whole 4.x line, no key, commercial use included. And if your Changelogs for the four products, all released together on 11 September:
The announcement, with the breaking changes and the upgrade notes: https://github.com/orgs/redbase-app/discussions/13 Thanks again for this thread. Two of the six were roadmap items your write-up moved to the front of the queue, and the rest were defects worth fixing on their own. |
|
One more thing that belongs to point 6, and it matters if you actually stored bytes on 3.x. In 4.0.0 the whole binary path works, on all three providers and both tiers: On 3.7.2 that was not the case, and one combination deserves a look because it was the silent one: SQL Server on the Free tier never wrote So if a 3.x SQL Server database on Free stored anything through SELECT _id, _name,
CASE WHEN _value_bytes IS NULL THEN 'NULL'
ELSE CAST(DATALENGTH(_value_bytes) AS varchar(10)) END AS bytes
FROM _objects WHERE _name = 'your object';Those bytes never reached the database, and 4.0.0 cannot recover what was never written. A |




Uh oh!
There was an error while loading. Please reload this page.
Hello,
I'd like to give you some feedback after playing redb for some hours:
The async methods do not have a CancellationToken.
It would be nice that RedbObject has a DebuggerDisplay attribute or an overriden ToString so when you are debugging you can see more useful information of the underlying TProps in order to get more information without having to expand the objects. This does not help:
Imagine if it shows the Id, Name and ParentId values, as well as the ToString output of the TProps. That would be very useful.
In my company we use Impersonation a lot. A lot of customers call and the operator uses the application impersonating the customer. I think that it will be a nice addition to add impersonation support to _objects, because you want to know who did something and if it was impersonated or not. Also, if I don't specify any user, everything is stored using the user 0 (sys). I'd expect a null or maybe the default user (-1)
The audit information is very basic (who created/modified it and when). As in the pro version you have the diff, it would be nice to be able to configure full audit information (so the pro version can save that diff somewhere).
The soft delete seems to be a delayed delete more than a soft delete as I see no way to really undelete anything that has been soft deleted.
If I create a RedbOject where a property of A is of type RedbOject, when I save RedbOject, 2 entries in _objects are created, one for A and one for B. Also, an entry in _values for A references B using the _Object column. However, if I want RedbOject with A having a property of type RedbOjbect (non-generic, as I only want to use a basic value (byte[] in this case), it fails generating the _structure:
You can reproduce it adding this code to the Product class in the default template:
I was hopping that to work and then use the ValueBytes of ByteVal1.
Hopefully you find some of those comments useful. Best regards.
All reactions