Marten

Marten, PostgreSQL as document db for .NET

Marten, PostgreSQL as document db for .NET

Since they include the JSONB column type a while ago I was thinking about using PostgreSQL as document database. But I had no time to implement something like this myself yet. So I was happily surprised when I stumbled upon Marten a few weeks ago. Marten is a new persistence library for .NET that provide document db functionality on top of a PostgreSQL database. This was exactly what I was thinking about. It is created by Jeremy Miller the creator of SturctureMap and the Fubu stack. And tough it is still in an early stage, the supported features look already promising:

  • Schema-less document persistence with ACID support
  • Linq support for querying
  • Unit of work with Identity Map and optional dirty checks
  • Optimized batch udpates
  • Compatibility with  RavenDB client API (or close to)
  • EventStore on top of PostgreSQL with sycn and async projections

What is a Marten

A Marten is a cute animal living in many parts of the world. Check it out yourself:

14674805776_b9180bf828_o-300x214
Source: Flickpicpete

Why PostgreSQL

Since PostgreSQL version 9.2 they started to include more and more features to support a JSON column type. This allow you to store and retrieve schema-less documents in the database. And since 9.4 they included a binary JSON (jsonb) column type that support indexing on fields in the json data. Besides that PostgreSQL also support all traditional database features like ACID support, while many Document database lack this. This makes the database a good candidate for many software projects that need the productivity of storing schema-less documents combined with the advantages of traditional databases (eg multi document transactions).

PostgreSQL also has a huge supporting open source community and there are many tools and extensions. Some examples of these extensions are:

    References

    I will probably blog more about this topic later as I started contributing to the OSS project. And I hope to be able to contribute more on this awesome project in the future.
    In meanwhile you ca find more info here:

    Ampion Bus

    Ampion Innovation road-trip through East-Africa

    Ampion Innovation Bus

    Recently, I was lucky to be part of the Ampion Venture Bus! Ampion is a Berlin based organization dedicated to accelerating businesses and connecting social entrepreneurs, IT engineers and designers throughout the emerging world. A Venture Bus is a seven-day road trip where innovative ideas are developed from scratch with the guidance of mentors. Each bus contains around 40 young people who are an average age of 27 years old. Half of these young people are international and the other half are from Africa. At the end of the week, the best teams pitch their ideas in front of a high-level jury, including investors and venture capitalists. The best startups of the week have a chance to apply to a 12-month Ampion Fellowship Program—including mentorship, a small grant and office space provided by Ampion.


    ampion
    I really believe the mobile and internet revolution has the power to change the life of the people in emerging countries, and I wanted to be part of this revolution. So I applied to go on the East Africa trip for 2015. Each candidate is carefully selected by a written interview and one or more technical interviews. Needless to say, I was so happy to be selected out of many candidates.

    This was an experience of a lifetime.

    Healthcare in Africa

    Our startups would be working on the theme of e-health. Healthcare is one of the most important causes on the planet—especially in Africa. There are so many deathly emerging diseases, including monkeypox virus, Rift Valley fever virus and, of course, the Ebola virus that was such a huge deal in 2014. But there are also a lot of reemerging diseases that cause havoc all the time in this continent: Smallpox, malaria, tuberculosis, yellow fever. These diseases spread very rapidly, and it’s obviously a major concern.

    Some African people aren’t well-informed about health issues due to cultural and religious beliefs. Africa also has a lot of issues with fake medicine, witch doctors, and uneducated people pretending they are qualified to perform medical care. We heard a story about a doctor that administered red soda water to a patient instead of blood. Sadly, death was the consequence of this deception. Another sad story we heard was about a fake gynecologist who was accused of drugging and raping his patients. Clearly, e-health is an important area to focus on in Africa, and we were excited to help out.

    The Tour

    Ampion runs five tours throughout all of Africa. I joined the East Africa tour, which started in Dar es Salaam (Tanzania) and traveled consecutively through Arusha (Tanzania), Nairobi (Kenya), Kisumu (Kenya), Kampala (Uganda) and Kigali (Rwanda).

    Map

    At each city, there were local hubs dedicated to supporting local entrepreneurship. All the hubs provide a free open community place that organizes mentoring programs for young people to start their own tech businesses. They guide young people with business advice—such as product development, customer/market validation, funding—and they also support with technological advice so that even non-technical people can start their own businesses.

    I have to admit I expected small, self-organized communities of people interested in startups. But these hubs were very well organized in high-end buildings with support from governments and universities. I was positively surprised about the advanced infrastructure available to support startups and social entrepreneurship in Africa. This indicates how little we in Europe know about African countries and the emerging world in general. We have so much to learn.

    The last stop of the tour was the Transform Africa Summit 2015 in Rwanda. The theme for this summit was “Accelerating Digital Innovation”. There were over 2,500 international participants—including Rwanda’s President Paul Kagame and respected people from top technology companies like Facebook. The top three winning teams of our tour got to pitch their ideas at the opening gala dinner in front of around 300 people.

    transform-africa

    Developing Ideas

    So how do you find innovative solutions for real-world ideas? The process we used on the bus was Design thinking. Design thinking is an iterative process that starts with defining the problems in order to develop and test solutions. And it goes like this:

    Design-Thinking

    To evaluate the business validity of the found e-health solutions, we used the Lean Canvas model as proposed by the lean startup business modeling methodology:

    Business_Model_Canvas

    When it was proven that a e-health solution had business potential, we started focusing on pitching the solution and presentation skills. This pitch was repeated and evaluated several times so that in the end it could be pitched in front of the Rwanda ICT & Youth minister at kLab in Kigali. The three winning teams were announced:

    1. Mitambo is an online platform used to improve the maintenance and lifetime of medical devices. It’ll be used to educate and connect support engineers. It also allows one to monitor and diagnose machines online.
    2. The Waiting Line takes advantage of the time people have to wait in line before having access to a health service. This time is used to gather medical data and to educate the patient.
    3. mOkoa—the team I was part of—got third place with the solution to improve the control of disease outbreaks. More information is below.

    The mOkoa Team

    mOkoa-team

    As mentioned above, disease outbreaks are a horribly common problem in Africa. Detection rate is very slow, and the time that passes after an outbreak and before action is undertaken is still way too long. This causes a lot of unnecessary deaths that could be prevented.

    After defining the very real problems people face in East Africa surrounding diseases, we formed a team, came up with an idea, and named it. Our team was a multidisciplinary team of six people from four countries with many different backgrounds. Okoa is the Swahili word for “to save” and the m stands for “mobile”. So we combined the two words and made mOkoa. The goal of our team was to save lives with mobile technology!

    Our solution to the problem of disease outbreaks was to provide local health centers—called dispensaries—with a mobile tablet device that will be used to report patient symptoms and diagnoses. This tablet contains our mOkoa mobile app, which is used to enter all required data about the patients. The app will then send the data to the centralized mOkoa system by the mobile data network. Because not all rural areas are covered by mobile data access, the app will fall back on sending the information by USSD (SMS) if no mobile network is available.

    The collected information is analysed to create real-time heat maps of the spreading of diseases. Based on this information, alarms can be sent to health workers and people in the field by SMS. People who receive the alarm will know that they have to be careful and will also receive prevention information on how best to handle the outbreak.

    High-speed information about disease outbreaks will save many lives. Early detection is key, and my team and I really believe mOkoa will truly help with this. I was very honored to work alongside the teammates I worked with, and we really learned a lot while developing this startup idea.

    When the Shit Hits the Fan

    This blog post wouldn’t be complete without some general thoughts about Africa, now would it? There was the good, and there was the bad. I’ll start with the bad first.

    You probably won’t be surprised that we had some bad luck with the bus trip in Africa. I expected some problems myself, but the reality was a lot harder than I imagined. First off, the bus was not the newest and lacked A/C. Secondly, we had a lot of health issues—mostly due to insufficient food hygiene resulting in many toilet stops on some specific days. You can view a live report of the outbreak here. Due to these problems, the road trips consisted of 50 percent more daily driving time than originally planned: This was around 10-12 hours on the bus per day.

    Last but not least, my bags—along with two fellow passengers’ bags—were stolen while traveling from Kenya to Uganda. Loosing all your stuff is not really enjoyable while in the middle of a trip. It involves a lot of unnecessary trips to super markets and shops. In the end, though, I was happy that we only had material loss and nothing really bad happened.

    Enjoying Africa

    All in all, I really enjoyed the trip from the beginning to the end. For me, it was an eye opener on how the people in Africa live, and I was positively surprised about the enthusiasm and engagement of the local people! The people are well-educated and well-aware of the shortcomings of their countries and the systems they live in. More importantly, they’re highly motivated to do something about their situation. I’m confident that some of the ideas developed on the bus will result in really successful businesses in the near future.

    All the African people were a lot of fun to hang out with. They have a great ability to reevaluate everything positively with a great sense of humor! Whenever something doesn’t go as planned, they say among themselves with a big smile: “T.I.A. This Is Africa!” They are proud about their countries. I’m very glad I got to see Africa and learn more about its diverse landscape and cultures through this trip.

    Thanks, guys, for the great trip!

    To see some amazing videos about the trip, check out Nick Van Langendonck’s YouTube channel! He was my partner-in-crime on the bus.

    Last but not least, here are a a couple pictures taken while on the road trip.

    Enjoy! 😉

    the-ampion-bus-845x684

    working-on-the-bus-845x684

    great-rift-valley-845x684

    kilimanjaro-845x684