These are chat archives for damianh/Cedar

8th
May 2015
Adam Ralph
@adamralph
May 08 2015 05:34
bit of an overhead to try parse every serialization into json no?
I know the current code is very young, but the only constraint here is GES's isJson
dunno if it's worth displaying JSON semantics in the lib just because of that
given it's a GES constraint, you could do the try parse in that provider to determine the value of that argument. In all other cases you can just ignore the serialization format, but only provide a JSON serializer out of the box
or you could just keep it as it is now, but I wouldn't bother doing the try parse. If the type is named IJsonSerializerthen the semantics are clear. If someone wants to plug in a silly IJsonSerializer that produces non-JSON nonsense then it's their problem when it blows up
Adam Ralph
@adamralph
May 08 2015 05:45
I know nothing about GES, but the isJson parameter seems like a WTF
if it is, I would take the hit of doing a try parse to determine the argument in the provider, as an anti-corruption layer
if it turns out to be valid, then I suspect it's something you need to surface out in the cedar eventstore API. Other providers can ignore it
Yves Reynhout
@yreynhout
May 08 2015 11:21
I would be inclined to go with byte array + mimetype and good viewing support built-in TBH.
At the end of the day that is the contract - the serializer is just an implementation detail.
Yves Reynhout
@yreynhout
May 08 2015 11:26
I don't think you should limit yourself to json. It does limit some assumptions in other parts of the lib you can make, but coming back on that decision is easier when constraining things.
Adam Ralph
@adamralph
May 08 2015 12:26
agreed
I also thought about mime type
but was a little uncertain if a good idea or not
Yves Reynhout
@yreynhout
May 08 2015 14:10
@damianh Bring your own datareader for the table-valued parameter: https://msdn.microsoft.com/en-us/library/bb675163.aspx
You might wanna have a strategy because it only starts outperforming the alternative as of 4 rows (according to the above article) aka events.
But then yeah: parameters for up to x rows (x => measuring is knowing) and tvp as of x < #events
Yves Reynhout
@yreynhout
May 08 2015 14:17
Typical command => event transition is 1-to-1 hence why a strategy might make more sense.
Yves Reynhout
@yreynhout
May 08 2015 14:38
@damianh Re: Deletion marker records: current thinking => negative stream revision numbers :-) -2 = $Deleted, -1 = $Created, 0 = SomeEvent, 1 = ... - going to try it out and see what gives.
Yves Reynhout
@yreynhout
May 08 2015 14:46
Wrt hashing: am going with MD5 which has an output length of 16 ... and stuff it in a UNIQUEIDENTIFIER - weird silence ensues
Actually with all this SQL stuff, I think Frans would be a good guy to review the impl.
Yves Reynhout
@yreynhout
May 08 2015 17:08
Quick heads up: tvp can be an IEnumerable<SqlDataRecord> where SqlDataRecord is https://msdn.microsoft.com/en-us/library/microsoft.sqlserver.server.sqldatarecord.aspx