Setting metadata immediately after creating a new stream - is it guaranteed to work?

Please can someone tell me…

If I write an event to a stream that didn’t previously exist, e.g. “foo-1”…

does that immediately (not eventually) create the corresponding metadata stream, “$$foo-1”?..

thereby allowing me to write to the corresponding metadata immediately after writing the first event which creates the stream?

Scenarios:

  1. When using the .NET API to a single ES Node?

  2. When using the HTTP API to a single ES Node?

  3. Presumably harder to answer when using a cluster?

My concerns:

Might the two events fired into the HTTP API arrive in the wrong order?

Do the tcp clients (e.g. .NET and Java APIs) deliver my requests in the order that I send them?

Does ES process the events in the order it receives them?

I might have just answered this for myself…

Am I right to think:

  • the relationship between foo-1 and $$foo-1 is loose and convention-based, rather than some tight dependency? (Please forgive my poor choice of terminology)

  • creating a stream, does NOT create a corresponding metadata stream

  • I can actually create my metadata stream FIRST

  • creating the metadata stream similarly does NOT cause a stream to exist

  • the data stream will be affected by the $maxCount, $maxAge, and $tb values in its corresponding metadata stream “IF AND WHEN” it exists?

It is convention based. We look for the $$ stream if it exists it gets used if not it doesn’t hurt anything