 So my name is Matthew and I kind of use this emoji dog as my logo, but I normally recolor him as like blue and blue. So I guess everyone knows about Meteor and I still really like the properties of what Meteor brings to client-side development, in particular I guess if you've done the examples from the site then like this is my browser, this is someone else's browser, I go and add a party and like instantly it synchronizes with all clients and like Meteor does other cool stuff as well like actually if I roll out a new version of my application then everyone gets it updated. So Meteor is great but it's kind of all-or-nothing like you kind of you buy into the stack and you buy into MongoDB and you buy into like their sort of data synchronization and you're probably going to end up buying into their sort of containerization solution after 1.0 as well. So this is the announcement like sort of final announcement of like 1.0 is going to be but like that's me and I'm kind of playing on my phone. So I love it but like I'm not really buying into it right now, so what can we steal from Meteor, what can we learn from them and this is their set of bullet points about what they think is good about Meteor. So it's pure JavaScript like it does live page updates, so pure JavaScript maybe doesn't matter because actually I like that separation between the server and the client. Live page updates or Ember and Handlebars kind of gets us that. Clean powerful data synchronization is pretty cool and we don't have that latency conversation doesn't really mean anything but the idea is kind of like a fire and forget and then we get a call back and says this update failed and we resurrect the state. Hot code pushes is actually also another cool thing and I don't have a solution for that but I think that's a deployment framework rather than a web development framework and I think Meteor kind of combines those two things but actually we can build this separately but it's a sensitive code runs in a privileged environment and that's kind of a compromise if you're not going to have a protected server then you have to have sensitive code somewhere. So like generally let's have a server in API and we'll do sensitive stuff there and it's fully self-contained application bundles and that's true like you can take your Meteor application and you can bundle it and you can run it inside any node container but it's not quite true as well because you still have to get all this sort of MongoDB data synchronization and like ongoing basically you can have MongoDB with like multiple like read only slaves and it's going to because you actually want to scale Meteor then it's a different problem and interoperability is actually their point about interoperability is that actually we can run Meteor on like a Raspberry Pi or something it's like we can use it for different purposes other than other than serving web applications smart packages doesn't really matter it's just how they package Meteor so ignore that so I kind of went through and said oh yeah some of them I care about some of them I don't but the thing that actually maybe we can tackle right now is clean powerful data synchronization so we create some data here and then anyone can read Chinese what does it say oh man it says neither lian her me which means your face is very beautiful but suddenly we're gonna synchronize it here and here and here so perhaps if we if we want to kind of right now like reproduce the functionality of Meteor's data synchronization synchronization we should use Firebase because Firebase is a kind of well-funded startup it's kind of I said it was a hosted JSON object store with built doesn't make sense built for data synchronization and that's what it is it's basically a web API a rest API where the URL defines the object so looking at this we jump into the players and the players has for each key we can go and access that URL and incrementally we get like a dig into the data and it's all URL based and they are also all hosted on the Firebase IO domain so how do we use it with Firebase's API right our very long URL and Inc like instantiate a Firebase objects and then fundamentally like you have this reference but because everything's asynchronous and it's all about synchronization like you can't just directly access the object so actually if we're talking about an array or a thing that approximates an array we have to then go and listen to the child added event and then start pushing it into our into our local object store so in this case we take we instantiate a players array which initially has nothing and as soon as we've listened to the child added event then it will start pushing the data into there but the and even though that's kind of annoying but we do actually get incremental like calls on that callback as well so whenever any child is added from any client we still get added to our players object and there's also other the core events are child added child removed and child changed and there's another one that's called value which is like gives you the whole objects and get called whenever the object changes but I'm going to know that for now so we want to load up a love lace so we can literally we just loaded in the previous screen we loaded the the ref which is our players object and we're going to get the child which happens to be dash J836 to the whatever but like but what's cool about it is that this is always going to be unique ID and we can just treat it as like a as like a unique ID so we get Ada and we're going to set her name to Augusta Ada Byron which apparently is her her born name and like immediately we'll get like an update of the the data on every client right and that that's that's what we're trying to achieve but importantly in that case we lost the the score so there's an alternative thing which is updates which only changes that that field so set is for like taking over the whole object we're placing the whole object and update just updates the fields we've given it so it's pretty simple and Albert so actually the reference here for players is actually in a we can treat it as an array and we can just push another object into there and it will go appear on the bottom as like a new unique ID object and again every client who's already listening to the players of the players array will get a new child added and because we've already we're listening to child added we'll get that called again and we'll end up with Albert as a the last player and our players array so by this also does like way more stuff and in particular like it does authentication so we can use Firebase not just as a data store but we can use it to as an authentication like platform as well which then ties into the data store so permissioning is also very important because how do we decide who can read and write our data and like actually my demo like right now anyone can change anything because there was no permissions and he also do ranges because we don't necessarily want to load up like an array of a million objects and ordering and all this stuff so it's a dot dot dot so Firebase are like again they're well-funded they've been around like for like over a year and there had been attempts to implement like ember adapters like particularly there was a thing called ember data Firebase adapter but it was before the ember data beta so it's now at least be rewritten but about a month ago or so Firebase like launch like what they call like fire and the fire which is they're officially supported ember adapter you can see it on there their GitHub but to be honest like I don't think that their version works but because no one's using it so they've gone through and there's like a thing called Angular fire there's like backfire which is the backbone version of it and I think they've they have he tests and they've just written like they've created adapters but haven't really maintained them and they don't necessarily work so I instead of like writing a talk I basically spent most of my time trying to rewrite ember fire and I've rerun in two different ways and I'm still waiting for them to decide which one they want to they want to pull but basically it can be explained like this so we have an ember fire object and we're gonna use embers like object proxy which just lets us create like an ember object type thing but actually we're not directly accessing a an object with we're proxying them so we set a ref and literally whenever the value changes we just update the content and what's cool about this proxy is that we can keep the reference separate to the object and we can use it to listen for events and obviously like once we've instantiated this it will just update itself whenever the data changes so if we can get that entire entire application it will just update the view and because it's an ember object proxy handlebars already knows how to render this and already has the right bindings so this isn't the wrong order but so basically we're trying to wrap how can we wrap Firebase into ember objects so the other thing which is like my idea because I like because I literally just want to have an array of objects and actually the current ember fire array doesn't necessarily get you an ember object so ember fire rate proxy is basically the same thing but we have to store both the content and like these sort of ID equivalent references so actually we only need to look at like child added and child removed so whenever there's a child added we need to add both the content and the reference and make sure it's the that's it basically and then removing is literally just removing those two things and there is a lot more work as well because you need to this only deals with data changing on the server and we also have to deal with data changing from within our own application but the general point is that we should we should change we should send data changes to to Firebase and Firebase should inform us via the the event callbacks so actually we don't ever want to change these things directly but we'll let Firebase tell us to change them and the benefit of that is that we can it's any one place where we actually change to this core data and equally a consequence is probably not so great is that if we want to change an object then I assume it goes to the server before it files it back files it back I don't know maybe so based on what we're doing before like like this is like this you how I do in my example application is instead of creating a Firebase object directly I can just create an ember fire object array and I can just do it and it just works and on the same data it just works so given our previous example we can just take a day who happens to be the last object on the list and increment her score and it should just work but so so when I first start looking at Firebase I kind of realized that I had this kind of dream which was kind of to kill meteor and so so I came up with like a logo first of all and also a get a GitHub project so I want to take every meteor example and find a way that we can tidily like re-implement that that whole thing in ember so the only one I've got to do so far is leaderboard which actually is really really simple but I spent so much time trying to get and Firebase to work properly that got stuck on it but let's let's take that let's make it all ember so the one I've actually done is leaderboard so our example is just a subset of what the thing is but the core of it is like meteor gives you these collection objects which is basically a proxy onto a Mongo store that gets synchronized so players is just a Mongo store called players and importantly meteor you write this the same same code that runs on the client or the server we have to kind of ask if we're the client or the server in this case we only want the client to do it so in order I guess this just looks like Mongo right noisy but one thing I really don't like about meteor is that if we want to provide sort of view helpers we end up kind of appending functions onto these sort of template objects maybe there's a better way to do it but that's the way they do in their own example so I guess that's what you're supposed to do but equally like they do use handlebars so it does just look like like a handlebars loop but so I've rewritten this in ember and there's a whole lot more work but generally this is using ember data and we just sort like via computed sorting and we just loop it and it works in a similar way but it's it's got more structure and then perhaps that's not meteor's fault but the fault of the example but then if we try and add in like ember fire it does work but because ember fire is a different object we don't have which doesn't actually quite work with the ember's computed properties we can't do like ember that sort we have to create an array proxy that filters it but it pretty much just works the same way I think the next step is to go back to the old ember data Firebase adapter and build a new ember data Firebase adapter that fits into how ember data beta works and particularly like the separation between serializers and adapters and all these bits which actually should work on going but so there's still a lot of work and like I'm still only on leaderboard example and my own like fork of ember fire so if anyone like wants to kill meteor that'd be really cool if you can help me out otherwise I've been out my foodies so thanks any questions it doesn't work no testing I just refactored it because I think some of the ways to do some things I don't particularly agree with the problem is mostly literally because they don't they haven't you haven't really used it for beyond like the really simplest use case so particularly if you want to take an array of ember objects what ember fire objects it just doesn't work and I think we can make it work just in the way that we expect but I got loads of bugs basically and that's simple to fix so actually I'm refactoring it separately from fixing the bugs the bugs are fixed they haven't been pulled yet separately where I'm refactoring because I want to I want to make it look like ember data basically I was like 14 days ago so that's not the person who's been communicating with me okay I've assumed that I've assumed that it doesn't work but it doesn't work for me but like but I think the problem is we don't have like there is no test there's no there's only one very simple example it just pushes a chat into into the array I think we need an example that does more and actually uses like nested objects we don't have that no so so I don't actually want to use it like ongoing but I think it's cool like right now to to get similar functionality to meet your running but so so the other thing that you're going to yeah yeah what's our long-term plan for having something open source because firebases completely yeah yeah yeah so so so important that meteor have actually like created sort of deep I think it's called DDP is there sort of protocol for data synchronization and they're trying to make what what meteor does with mini-mongo like just generally an accepted standard and there were attempts to implement it in like postgres as well I don't know quite what's gonna happen I guess it's just gonna be like an object so maybe the real answer is meteor's gonna contribute that to the world even don't use meteor we can probably use that that's a hope that sink is really easy to do done and like pretty much impossible to automatically do good so like defy base to have like some amazing secret black box source like is it still you know just like last right wins or whatever like how is there some kind of like application level strategy to say like this is how I've no idea but maybe maybe Richard was still here we can talk about that because he's actually using it professionally I've no idea there's a library with sim period which does operational transform which is not last one right okay is that part of my base no different right it's the same paper right okay all that is open source shagging other examples of fire base being used in a more complicated scenario so we're gonna test that there is to whether they just have good marketing or so I'm also thinking fire doesn't work just that the enemy emma fire works but I mean again I guess the question that tells me about you know are they solving the simpler problem and producing nice marketing that top that are they solving a complex problem that's worth you know that's worth something it's fine base also part of their services you can you can kind of encode permissions logic into your data store that's a Jason format like say this like this part of your object tree has a certain conditions and has to fetch a user and I haven't used it much personally it looks at the docks a little bit but yeah I mean they there's that kind of stuff to consider as well so even if you do have a something like shaggy has some operational transform stuff you still have to think about security I guess that's part of the offer I mean you do have to think about it though I think I think the one the things is then you kind of date tie your data structure somehow into yeah you know just get that permissioning so does my basic advantage is that the way it's no doubt it's back by WebSockets yes I think the client library won't fall back to you won't pull it out of solutions if they're very well so it's unavailable