Mindscape’s Lightspeed

John-Daniel over at Mindscape e-mailed me yesterday at 2:50am (fortunately, he lives in New Zealand…) and suggested I write about the release of Mindscape LightSpeed 3.0.  He offered me a LightSpeed 3.0 license free for me to give away in any way I want, which I thought was pretty cool for reasons I’ll get to in a moment.  He also wants to entice me to write such a post by offering me a free license of any of their tools, which unfortunately is not as cool, for other reasons I’ll also get to in a moment.

But first, some background…

The background

Hurdles come in all shapes and sizesFor the software that I’m developing for my own business I had an absolute nightmare with persistence.  My software is a thick client application that will run on people’s desktops or laptops.  In an internet age this may be considered a little bit shocking;  several years ago I worked for a company that had a decree (delivered from on high) that all future applications would be written for the web. With Google building everything on the web, and Microsoft moving Office to the web, and all the talk about cloud computing it seems the web is the place to be.  However, my clients often use their laptops in places without wireless connectivity, the software is doing a lot of computationally intensive stuff so hosting it in the cloud could get pricy quickly, and finally the software deals with very personal data, and my clients are very leery of not having this data secured locally.

Additionally,after interviewing lots of clients, I came to the inescapable conclusion that my clients are not computer experts nor do they want to be.  I know this because they told me that in exactly those words.  🙂  So making them install or even attempting to automatically install some form of traditional client-server database was out of the question.

So from the early days when I was designing/architecting my application I knew it needed to use an embedded database.

Forget puritan dogmatism, for me its about productivity and getting useful things done, so I definitely did not want to hand-code SQL for all 500 database entities in my application.  Starting a green-field application I also wanted to focus on the domain model and do domain-driven development.  The database then  becomes a mechanism for persisting data, not the end-all-be-all of the application.  So any ORM tools that require building the database and then automatically generate some pseudo-domain-layer were not for me.  I spent about a week full-time just finding ORM tools and downloading them and trying them out.  Some hadn’t been touched in 5+ years and many were simply gone entirely (which made evaluating them very easy 🙂

So I finally started developing with SQLite, which is a great little free database.  Many of the ORMs available do not work with SQLite, which ruled them out immediately.  (I did spend a week trying to get Firebird to work as an embedded database, but no such luck, and MySQL is VERY expensive for an open-source product if you need to use it as an embedded database in a product that you’ll be selling!)

I decided to use the Microsoft Entity Framework to communicate with the database, which had just been released about two weeks before I started development and was being pushed hard as the greatest thing since sliced bread.  Unfortunately, I quickly realized that the Entity Framework was “twisted and evil”; I found the three layer abstraction great in theory and really lousy in practice, the VS2008 designer was incredibly lacking and buggy, and error messages were so complex not even Google knew anything about them.  I tried using Microsoft SQL Compact edition, with the same exact database model I just got completely different complex error messages.  So I threw out all that work (it wasn’t much) and started again with good ol’ reliable NHibernate.

Only, I immediately had headaches with that too; for all of the Hibernate croud’s ranting and complaining about the Entity Framework I found NHibernate to be really just more of the same:  their puritan dogma of “transparent persistence” is great in theory, but oh by the way we don’t have any GUI for .NET folks so just hand-code the XML (?!), oh, and you just need to make all your properties and methods virtual, so oh yeah your classes can’t be sealed, and you really need to ensure that you only use interfaces for collections (so no someList.AsReadOnly()), and you can’t just have one class have a reference another because that’s really not good database design, etc.  It certainly didn’t feel terribly “transparent” and it definitely wasn’t productive.  So in the interest of protecting my domain layer I switched to using Castle Active Record.  Putting a few attributes on my classes and properties is MUCH better than having to completely change the way I design classes.  I still had to jump through hoops when dealing with collections, but everything was much easier and faster.

This worked for several months before the puritan dogma of NHibernate broke through the Castle Active record abstraction and bit me very hard; so I went back to the drawing board.

I decided to use an object database:  DB4O.   Development has been incredibly fast ever since; everything is so darn easy, I haven’t thought about persistence in months – everything just works.

Ludicrous speed!

When a client came to me recently and wanted to build a rich internet application I quickly realized DB4O was the wrong solution.  For one thing, it’s single threaded, so it definitely doesn’t fit the internet world.  I read about a few people that tried it anyway with poor results.  I really wanted to use Eloquera, but they don’t have LINQ support yet (and LINQ is just so darn productive that not using LINQ is stealing from the client).  So the hunt was on for a good ORM solution that was easy to use and supported LINQ.  Additionally, object databases are (sadly) not really mainstream, so it just wasn’t a good fit.

Fortunately, I still had the evaluations I had done the previous year of every ORM tool out there I could find, so I just researched the top few tools and examined the latest additions.

Mindscape’s LightSpeed had been a top contender before, and it came out on top this time around.  Everybody that’s used it seemed to love it, and having used it myself now it really is a great tool with great support.  The visual model designer is integrated directly into visual studio and supports both forward (to the database) and reverse (from the database) generation.  You don’t have to use the code-generation feature at all (although I do), and what is really great is that it automatically generates data transfer objects (DTOs).  These DTOs are all partial classes with many partial methods, so it’s easy to extend them and hook in custom code.  It’s very well thought out.  They have also responded to every forum post and e-mail in a very quickly.

My client is happy because I am very productive (and he pays by the hour):  I can easily design new entities, and use the automatically created DTOs to send the entities to the Silverlight client via WCF RIA Services.  (This only required a small change to their code generation templates).  I spend most of my time focused on the actual Silverlight application and a very little time worrying about database persistence and wire-transmission.  Development the way it should be.

I should mention that I still designed the database-access layer so that it completely encapsulates the use of Lightspeed (although it does expose the automatically generated DTOs).  I believe this is just good layered design, although it would in theory allow us to switch out Lightspeed and use a different ORM (what?)

Mindscape’s offer

While Lightspeed is Mindscape’s flagship product, their other products don’t really interest me that much.   I’ve already got the Actipro WPF Property grid (and I don’t need it for my software) their WPF Flow and Star Diagrams looks interesting, I don’t need either.  Their “Essential WPF Control set” is underwhelming, especially when compared against Actipro’s WPFStudio which is great and also comes with themes. So while they have offered me a free license to any of their other tools for blogging about them, I just don’t need any of them.  I just wanted to blog about them anyway because LightSpeed is cool.  🙂

Your free Mindscape license

If you’d like the free license that Mindscape has offered, drop a comment below, I’d love to hear from you about what you’re currently using for persistence (if anything) and why you want to try something different.

Object databases

Speed: For object database sceptics, in my tests, the object database Eloquera was just as fast as the LightSpeed over SQL-Server combination, and LightSpeed is very fast.  Micro benchmarks never tell you about real-life, but my little test was a multi-threaded test with multiple instance types and inserting and updating hundreds of thousands of entities.  The guys over at Eloquera are also doing a great job.

Licensing: With Eloquera’s new licencing model I’ll probably be switching my own project over to Eloquera when they get LINQ support, because DB4O’s draconian royalty based licensing is cruel and unusual punishment for a small business struggling to get started.  (And sadly the .NET version of NeoDatis has completely stalled, although if I start making cash I’m tempted to donate some to the NeoDatis guys to see if we can’t get it going again).

Advertisements

7 comments so far

  1. Dmytro on

    Hi Robert,

    We have 2.5 version available that supports LINQ.
    http://www.eloquera.com/page/download.aspx

  2. Josh on

    Hello Robert,

    I run a small startup software company that’s trying to transition from a consulting-based company to a product-based company. I am looking for a persistence engine to use with the software I am going to write in the New Year and I’m evaluating technology over the holidays. I’m looking for something that is simple to implement and performs very well using LINQ, much like the requirements you describe. I don’t want to spend time writing my own persistence and I also don’t want to use a persistence engine that is so complicated that I would be better off writing my own 🙂 In addition, it will need to support multiple databases – at the very least Oracle 9 and up as well as current versions of SQL Server. I’m planning to support cloud-hosted as well as in-house hosting of the software, and would like the objects to be able to be used over the wire (DTO). Also, anything I might use must be model to database, not the other way around. From what you described, LightSpeed may indeed be what I am looking for, especially as NHibernate and Entity Framework seem very complicated. I would be very interested in the free license that Mindscape has offered – it could really help my company get off the ground.

    Thanks,
    Josh

    • robertmccarter on

      Done. Yes, I think LightSpeed would be a perfect tool for you. Let me know what you think of it.

      Best of luck with your business!

  3. Fakhru Rahman on

    Hi,
    I was using LightSpeed ORM Express Edition for my small Commercial web.
    Before, I used LightSpeed Express I was using Telerik OpenAccess ORM (Free Edition to).
    Some reason that make me switch to LightSpeed is, OpenAccess make CRUD more complex.

    For example to delete object with child (in one-to-many relationship) I must load all collection of child object before remove it, and OpenAccess send Delete Query to Database every deleted child object.

    In LightSpeed, only 2 queries send.
    And it’s seem LightSpeed team has do their homework to optimize all query.

    I’m also interested in the free license that Mindscape has offered, because the Express Edition only allowed to use 8 Entity.

    Best Regards,
    Fakhru Rahman

    * Sorry, my English quite bad, I’m from Indonesia *

    • robertmccarter on

      I haven’t used Telerik OpenAccess myself, so your experience is interesting to hear.

      I agree with you that the LightSpeed team does their homework; they work very hard to ensure that the database access is as fast and efficient as possible. I’ve seen them turn down feature requests and delay new features because they wanted to ensure the design of their solution wasn’t comprimised. Very smart.

      Unfortunately I already gave away the free license, but their software really isn’t that expensive; I also much prefer their new simplified licensing model.
      If you still can’t afford it, I’d recommend talking with – they seem like very good people (maybe they could charge you in Indonesian currency rather than USD?)

      • Fakhru Rahman on

        Thank you for your reply, I will try to contact them directly for licensing/pricing question.

        I haven’t try using any ORM to build “big” project, based on your experience is LS good enough when Entity grows, say 100+ Entity ?

        Best Regards,
        Fakhru Rahman

  4. robertmccarter on

    I haven’t used it with 100+ entities yet, although from what I have seen I would be very surprised if it didn’t scale out nicely.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: