D for microservices

Adam Wilson flyboynw at gmail.com
Wed Oct 25 22:53:32 UTC 2017


On 10/23/17 23:29, Jacob Carlborg wrote:
> On 2017-10-24 00:02, Adam Wilson wrote:
>
>> I've been looking pretty extensively at these two items recently.
>>
>> If the database drivers are compatible with Vibe.d AND we wish to
>> provide a common abstraction layer for them (presumably via Phobos)
>> then order for the abstraction layer to aware of the whether the
>> driver is making a blocking or non-blocking call we must include
>> Vibe.D in the abstraction layer. Ergo, we must include at least the
>> vibe-core package in Phobos, or more preferably, DRT.
>
> It can be an optional dependency. Looking at ddb [1] it's not that much
> code that will be different if vibe.d is used or not. It's basically
> only reading and writing to the socket that is different [2]. Dub
> provides predefined version for different dependencies, i.e.
> Have_vibe_d_core.
>

This of course makes the assumption that we clean-room our own protocol 
implementations which I am entirely against. Better to use what already 
exists.

>> I had heard noises about that a few months ago. Anything happening on
>> that front?
>
> No, not as far as I know. Sönke seems really busy recently.
>

That is what I was afraid of.

>> What would the appetite be for working together to come up with a
>> reasonably generic event loop for DRT that vibe and other systems
>> could then leverage?
>
> I would be really nice to database support directly in the standard
> library but it's not critical for me. It takes a lot of work with and
> massive overhead to get something into Phobos. It's also going to be
> really slow get in updates. I'm not sure if it's worth it.
>
> [1] https://github.com/pszturmaj/ddb
> [2]
> https://github.com/pszturmaj/ddb/blob/master/source/ddb/postgres.d#L189-L246
>

I actually don't think the slow updates are huge problem as these DB 
interface libraries are pretty slow to change themselves. For example, 
ADO.NET didn't change significantly from it's 1.0 release until the 
arrival of Async/Await in .NET 4.5, which was 10 years later. The 
biggest addition prior to Async was TVP support and that was tiny 
comparatively and came in 2005.

The libpq5 interface has barely changed in years. I can't speak to MySQL 
but IIRC it hasn't changed much either, at least not in a way that would 
effect the abstraction layer.

-- 
Adam Wilson
IRC: LightBender
import quiet.dlang.dev;


More information about the Digitalmars-d mailing list