SpringBoot – Mongo / Create a Mutex to synchronize multiple frontends

When deploying a API in a scalable environment we usually try tom implement a stateless solution to avoid parallelism conflicts between the different nodes.

This works well for event management synchronously executed. But in some case these event need to have a part of the work managed asynchronously. It was my was my case when I had to process alarm report potentially generating multiple communications with execution time not predictable. To manage this I decided to process theses operation asynchronously. There are multiple architecture for managing this like Queuing (my preferred) of dedicate asynchronous engine. I’ve in fact preferred another way to do it for keeping my infrastructure more simple : adding in all of my nodes a batch function processing the alarms asynchronously.

The alarm events are written into the database and processed by the first of the batch taking it. This allow to preserve a fully redundant and simple architecture. That said I need to ensure only one of the process will execute this process at a time and potentially split the work to do between all the nodes. For making this I had to create a mutex solution.

This post describes the way to create a Mutex solution based on MongoDB with Spring Boot.

Continue reading

Posted in Programming | Tagged , | Leave a comment

Getting started with Nucleo32 – STM32L031

I have this board in my stock since some months and never taken time to play with it. As I’m starting some developments with STM32 it’s time to do it. I’ve tried to do some stuff using it at reception but even if there is some kind of Arduino mentions on the package the start is not as easy as on Arduino. Not regarding coding (it is more complicated but it is not the problem) but regarding the development environment. You need to use different tools and find yourself the way to use each of them. In my point of view ST would do a good thing simplify all this stuff. So in this post I’ll describe how to get started by creating your first led blink project. Hope it will save your time.

 

Continue reading

Posted in Hardware | Tagged , , | Leave a comment

My little Bitcoin experience – Asic mining

Following my previous post on bitcoin I’ve start mining with ASIC to continue playing the technology. I’ve started with a small USB ASIC providing 2GH/s. This is equivalent to 200 times the power of my Xeon server and it was really easy to install, running on a Raspberry Pi to simplify the usage.

This post details this experience and gives some advices for one wanted to experience mining.

Continue reading

Posted in Technologies | Tagged , , | 1 Comment

My little Bitcoin investment & mining experience

I do not count the time I looked at Bitcoin in the past since about 2011-2012. Every time I started thinking about mining there was an investment to do (like GPU, then ASIC) and I never trust enough this money to make this investment. So as a consequence I never jump into this techno by the past, more than to understand how it works and learn.

Now Bitcoin in reaching some unexpected peaks ( > 15,000€ ) and it really looks like a bubble everyone is talking about, so as a mad man, I through it was the perfect time to start playing with this money. Trust me, as a guy who started investing in Internet technologies in 2001, you may never follow me on such decision !

Starting playing with this was an interesting learning opportunity, so this post will relate this experience and the different things I found in the bitcoin ecosystem.

Continue reading

Posted in My life | Tagged , , | 2 Comments

SpringBoot and JWT security

When creating an API you can manage a “session” with a JWT Json Web Tokens ensuring the user has login previously.

This post explains how JWT is working and how to implement it with SpringBoot using user identity stored in a Database.

This is based on a real implementation and is the sum of lots of search on Internet to make it correctly working.

Continue reading

Posted in Programming | Tagged , , | 2 Comments

IoT introduction

This IoT class is an introduction to IoT and LPWAN, it has been made to be a 2x2h teaching session for engineer school students. This class has been given to I.S.I.M.A. school in Clermont-Ferrand in 2017. This class has been completed by 2 more hours on the backend part for IoT by Daniel Petisme. It has been followed by three industrial conferences.

The content of my class had the following slides (in French):

Introduce why IoT is a revolution compared to M2M and why service matter. Introduce the different phases of a connected object design and the involved technologies. Introduce the challenge, from the technical stand point to the business model considerations.

Introduce the LPWAn technologies, presenting Sigfox and LoRaWan solutions.

 

Posted in Lessons | Tagged , , , | Leave a comment

The Sigfox radio protocol

Sigfox phase decoding

Sigfox is a LPWAn communication technology and network dedicated to IoT. The specificity of this solution is related to the LPWAn caracteristics : communicating Low Power (25mW) and Wide Area (60km).

This is possible thanks to particular radio characteristics and modulation. This post will describes how it works at radio level and protocol level.

Continue reading

Posted in sigfox | Tagged , , , | 12 Comments