We have a culture of always ?? learning and also ?? sharing ?? what we have learned along the way. Follow Zachary Wood to pick up some technical tips! ?? #constructionmanagement #contech #constructionsoftware #constructable #objectpool #syncengine
At Constructable we yearned to be able to query our data in our frontend as easy as we could in our Rails API using ActiveRecord. So we built it! It's called the "Object Pool", and it's a great example of the power of sync engines: Each model has its own file that defines its attributes and relations to other models. For example, an "Account" from our accounting module. On page load, our sync engine Replicache pulls all the current data from IndexedDB and loads it into the Object Pool. Then, in any component, you can synchronously query for any model and access all its relations. In the background, Replicache keeps the data up to date with the server, and any changes are immediately reflected, making every component "real time". This also gives us a central place to define common logic related to each model, resulting in an easy to use domain model that enables us to build tightly integrated experiences across our product without rebuilding APIs and duplicating code. I'm beyond happy with how our bet on Replicache/sync is playing out. It's taken us a bit to find the patterns that work best, but as we continue to iterate on these systems, I find that I've never enjoyed working in a product as much as I do Constructable :)