clojure-belgium

(map increase-clojure-adoption belgian-programmers)
raymcdermott 2016-12-20T08:52:03.000020Z

yes, for your solvathon โ€ฆ itโ€™s an intriguing proposal

kurt-yagram 2016-12-20T10:16:00.000021Z

๐Ÿ™‚ Well, I'll give you 2 very slightly related ideas/concepts:

kurt-yagram 2016-12-20T10:23:19.000022Z

1. zero downtime deployments: I know there are solutions, but I don't like most of them. For now, for example, the best way I found to have zero downtime during deployment, is starting your app 2 times - supposing you're having a (modular) monolith - listening each to another port. Restarting your nginx (or whatever you use), with a different config and when nginx is restarted, proxying the new version, kill the old one. (nginx keeps on running the old config until the new one is up and running). This is ok, but it's fiddling with ports and configs. I don't like it. There are other solutions as well. However, on linux system, there's something like SO_REUSEPORT/epoll and I know that netty somehow supports this (https://github.com/netty/netty/issues/2376). I just wonder if there a possibility to use this in your app, so that, if you start your app twice, the OS takes care of balance loading and redirecting calls to any of the apps listening to the same port! I tried it once, rather quickly, but it didn't work out fast enough for me, so I stopped trying ๐Ÿ™‚. The question here would be: how to do zero time deployments with as less as config fiddling as possible, or something like that.

kurt-yagram 2016-12-20T10:42:56.000024Z

2. distributed modular apps: I call this slightly related, since, if you have a really modular app (as I describe below), you don't need apply a new api pretty often, and you can just deploy new versions of 'modules' wherever you like, whenever you like. Real modular apps, well, I know it's all possible, and there are many possibilities here (many of them involving message queues). It's about: how to deploy a new module, or a new version of an existing module without bringing the app down? In many cases, I have an app in which I want to (dynamically) add new behavior. Most of the time, now, I use core.async channels, having a tuple [:topic message]. Than I have a bunch of namespaces, each of them listening to a topic. However, I have to 'register' all the namespaces. Adding a new topic, leads to a change in the existing code, where I have to add a 'registration' of that namespaces (otherwise, it's never picked up). I actually would prefer not to have such a 'registration'. That's something vert.x is doing really well (vert.x is rather nice, especially version 3, but there's no clojure support in version 3). I consider a few levels here: - in-app, you can probably use core.async channels, but I'd like to get rid of the 'registration', and also, deploying a new version of 1 module, well, for now, it's mainly deploying a whole new app (there may be possibilities with mount and component here) - in the same JVM: how to deploy different modules in the same JVM and let them talk to each other (again, I like the way vert.x handles this: it is possible to unload and load new verticles, and they're all connected to the same eventbus). - between machines/JVM's: what if we want to deploy modules on different machines? How to do autodiscovery? (vert.x uses Hazelcast, and it seems to be a pluggable system, so as far as I remember, they were busy with zookeeper a few months ago) How to have a kind of 'pluggable core.async channels', turning it into a real distributed message bus (or just wrap vert.x around it, for example)? How to limit the memory overhead of the JVM? What's the minimal Java-image (using JDK9 Jigsaw) you need to run clojure? ...? vert.x has some solutions to this - the vertx event bus with the autodiscovery is a very powerful concept - and also the guys from paralleluniverse have some solutions here. This doesn't mean, however, that clojure couldn't have an own solution ('distributed core.async': just send and don't care about the rest, possibly adding a reply channel? Or register all components somewhere in memory to dispatch to the right machine?). It might also just be fun to find out about performance, resilience, ... . This information is usually very scattered.

kurt-yagram 2016-12-20T10:44:44.000025Z

- or even, why not, use datomic to store the functions and distribute them in some way (although Datomic doesn't have a really nice/cheap license - free version includes only 1 year updates and support).

kurt-yagram 2016-12-20T10:47:00.000026Z

- what else is: why not having a system that can pull immediately from a repo (maven, or even just a source code repo) when there's a new version? For example: a new version of a module is pushed to the repo, the repo pushes a message to the app, the app downloads the repo, compiles if necessary, installs it, and removes the old version of the module (if necessary).

stijn 2016-12-20T12:03:35.000029Z

interesting topics

stijn 2016-12-20T12:04:45.000030Z

we are only aiming for the 'different machines' approach and are using uberjar + docker java image as the resulting artifact of a build

stijn 2016-12-20T12:05:11.000031Z

and using kubernetes to do the service discovery (it uses etcd behind the scenes) and scheduling of containers

stijn 2016-12-20T12:05:49.000032Z

that way you're not only limited to JVM solutions but can use any technology stack

stijn 2016-12-20T12:06:48.000033Z

zero downtime deployments are a matter of properly configuring rolling updates of new versions of the containers

stijn 2016-12-20T12:46:00.000034Z

I'd like to add: complex build pipelines. when your dependencies change, how will you make sure your entire deployment makes use of the right dependencies?

raymcdermott 2016-12-20T12:46:21.000035Z

@kurt-yagram I think these are quite difficult challenges โ€ฆ setting out constraints and seeing what groups of people come back with could be quite interesting. Not sure if itโ€™s great for a meet-up though to be honest

raymcdermott 2016-12-20T12:46:49.000036Z

having a back and forth and sharing solutions could be good

raymcdermott 2016-12-20T12:47:04.000037Z

but getting people to solve these complex problems is a big ask

stijn 2016-12-20T12:48:48.000039Z

or organize some small discussion groups?

stijn 2016-12-20T12:49:25.000040Z

we can also do something like this https://www.factual.com/blog/clojure-office-hours once in a while

raymcdermott 2016-12-20T12:51:39.000042Z

yes - like it - that seems like an interesting approach where people bring code to discuss

kurt-yagram 2016-12-20T12:54:00.000043Z

yeah, like it as well. I like people actually coding. It's easy to find discussions and blogs, but it's hard to find the actual real stuff.

kurt-yagram 2016-12-20T13:04:26.000044Z

@stijn: > zero downtime deployments are a matter of properly configuring rolling updates of new versions of the containers Right, things are always 'just a matter of', however, prefer minimizing 'just a matter of'. If one can make SO_REUSEPORT work, well, it's not 'just a matter of' anymore, since part disappears ๐Ÿ™‚. Same with docker, kubernetes, and stuff: I have done it (not extensively, though), and it certainly brings value, but not for smaller projects (spanning over 3 or 4 machines). You just have extra stuff to manage (the docker containers). We're already discussing ๐Ÿ˜›. > complex build pipelines. when your dependencies change, how will you make sure your entire deployment makes use of the right dependencies? Well, if you have small containers (in the sense of deployables), you actually avoid this complex stuff: each one can have it's own small set of dependencies, right? That's why a very modular design appeals to me a lot. Using vert.x in the past, I had verticles of less than 100 lines of code. The thing is: I could use an existing JVM to start them, so I could avoid the memory overhead for such a small module. I'd really differ between different levels of modularity, each needing a different kind of tech (higher level will probably lead to slower but more generic solutions).

janvanryswyck 2016-12-20T15:23:51.000045Z

A topic that I would be very much interested in is how to implement CQRS and event-sourcing in Clojure. Not exactly the why but more the how in Clojure. I do have some ideas about that, but I would love to hear about a real-world implementation. Any thoughts about this topic?

kurt-yagram 2016-12-20T17:32:34.000046Z

You have a use case? It might be fun to discuss that one, I think.

kurt-yagram 2016-12-20T17:33:06.000047Z

(Well, using Datomic leads rather automatically to something 'event sourcing'-like)

janvanryswyck 2016-12-20T21:11:44.000048Z

Well, there are a lot of examples in โ€œclassicโ€ OO languages like Java and C#. But in the functional realm I only know of a couple decent examples in F# and this one in Clojure: https://github.com/rill-event-sourcing/rill

janvanryswyck 2016-12-20T21:12:38.000050Z

I was just wondering whether someone in the Belgian Clojure community has any experiences to share regarding ES and CQRS in particular