 about to get started so if you're not sitting down yet please sit down there's plenty of space up the front there's these completely open unused couches anyone can sit there if they'd like no one okay all right no worries cool all righty then without further ado let's get started then um let's make sure everything's recording yep everything's recording cool well hello everyone how's it going are we having a good time we're enjoying this lovely weather yeah yeah i couldn't believe it like we we we left the hotel and we're like is it gonna rain no it won't rain it hasn't rained for the last two days and literally as we got to the point of no more cover over our heads it started pouring down we're like wow that's timing that's the best timing ever cool so thanks so much for having us um it's it's great to be back in singapore again i was actually one of the presenters at um ios conf sg last year i had a fantastic time singapore's a beautiful place it's just so green and now i know why um it's all the rain um but um yeah no it's really good to be back um anyway so first things first i've been told by my marketing team that um before we begin i need to get a selfie of us and everyone that we can we can put on our twitter page and everything so everyone wants to look really happy i'll hide i'll get the empty couch out of the way there we go off me it's not about me it's about you all right everyone look happy yay excellent cool okay hopefully i didn't kill my recording no i didn't that's good so i'm i'm recording audio through this and it's also serving as my notes as well through keynote so i'm testing the multitasking capabilities of this iphone pretty heavily at the moment cool and just before i begin that's our hashtag if you want to do some tweets or some instagrams or some snapchats or some other social medias um that's the hashtag to use um it is currently four in the morning in san francisco so they wouldn't be up yet but once the marketing team wakes up they'll start retweeting and um yeah it'll be good not the moment though unless unless someone's up at four and i hope they're not anyway so quick quick introduction about me my name's tim oliver some people call me tom but it's tim trust me um if you get a few giggles there i'm a product engineer at realm um which basically means i i started off on the cocoa side working on the the main products which was um the realm cocoa um and i and since then i've started moved to doing other things at realm like i started working on the auxiliary apps like the realm browser and i also started doing things like auxiliary libraries like um one of the things i i started started was a a small library to convert realm files to csv so a lot of like auxiliary tools and most recently i started going around doing presentations like this one here which we're all having fun at i joined realm at the start of 2015 so i've been there for uh going on two years now just over two years now it's been really fantastic um i actually went and lived in san francisco for a bit this year and just came back and san francisco was amazing i totally recommended if anyone wants to go visit it and yeah and it's just as you can learn so much over there i've been a fan of building iphone os sorry ios apps since the iphone 3g came out in 2008 i was amazed at the at the possibility of having a computer with internet always on in your pocket and just what kind of potential that can unlock as you can see there's tons and tons of potential there and it's really good to see that since then a whole industry has blossomed and it's it's great that we're all part of that uh when i'm when i'm not you know working on a database which is completely un ui related i also in my free time like to work on open source ui libraries so i do a lot of random view controllers that people can um put in their apps one thing i just released last week was i made i completely rolled from scratch the lock screen um from ios the the pin the pin cad with the transverse pin pad with the translucency effect um which i'm sure will never get approved because it looks like a security spoof but um it was a good it was a good challenge anyway and before i joined realm i was actually a realm user myself so um which is really really good because i got i got i got to try it first hand from the outside and i get a lot of feedback and a lot of that feedback was received was really good and i've been so happy with it i've stuck with him ever since um just as a quick show of hands who here has used heard of realm before people have heard of heard of realm cool that's three quarters of the room who here is uh compiled an app with realm in it before cool that's still more than half of the room who here is actually shipped an app on the app store with realm hey there we go they're the real heroes excellent my does about that was about 10 or so that's excellent cool so my lord i'll do a little plug my little app i used was um was a comic creator app so i was using core data originally because i needed to store um metadata i've calculated about both the the the file format um which the comic came in like the file metadata and also uh metadata per page so for things like calculating how much load will be on the gpu i need to know in advance what the pixel resolution of the of the page would be i did that in core data uh does anyone here have hands up who here likes core data silence no one wow oh wow okay yeah i feel the same way um yeah core data drove me to a near borderline depression at some point because just because it was so complicated the learning curve is so high and i basically just stumbled across realm and i was like i can't deal with core data anymore i'll try this realm thing there's no way it could be as dreadful as core data and thankfully it wasn't anyway so i'm not the only user at the moment we've uh we've calculated that we've got over a hundred thousand active developers so we have a little we we don't collect any personal data but we have a little bit of analytics in the in the binary that work that executes only the simulator so we can find out how many people are doing builds of realm but um that's all the info we get and i think marketing pulled some magic to calculate that we've now got an instance of realm running on over two billion devices in the world which is a an astronomical number it's crazy considering it realm is still very new and it's just really really good to see that so many companies that have taken it up and the the feedback's been really really good choosing means no bugs which is a good start cool so we've got two two i guess you call it products thingies at realm we've got two major products so i'll lead off with the the one that we came about during realms inception it's just been our leading product up until now it's called the realm mobile database so the concept of the realm mobile database is it's an on-device cross-platform object database so it's fully embedded it's not like a a web service or any other like things like firebase or anything like that where it's on the server with a casing mechanism on the device it's a fully offline on-device database it's cross-platform which means that you can actually generate a database file on an iphone and send it to an android and assuming you've lined up the the schema properly it will just open up which is really really powerful a lot of a lot of people think we're just another core data where we're just a convenient wrapper around sqlite that's not the case this is before my time but apparently how it went down was the two co-founders of the company were from nokia and they they created their own custom c++ engine for a windows app originally i think and then they were like hey this is pretty cool we could probably turn this into a database for other platforms as well so they actually came up with their own completely custom i think it might even be patented um set of algorithms that actually form the engine that is used to save data to the disk and get it back out again and just for just to clarify when i say save to disk realm is um it it it saves data to disk as a file format called dot realm so it's not a dot sqlite file or like a dot text file it's a binary file called a dot realm and so that c++ engine is what interacts with those files seems like so long ago now um the first the first version of um of realm well realm i think realm came out of that came out of that out of the um out of the shadows on july 2014 announced the first product which is realm objective c that was right after swift got got lot got announced i'm sure they're like oh no but um thankfully a swift version came straight after that but originally the core the c++ engine bit wasn't open source we were keeping that keeping that under apps until um our next product was ready but now as of last year in september it is now fully open source so you can go in there and see every single bit of code that went into both the uh the device level um versions of realm as well as the actual core when we do it all in the open so we we we do discussions through github issues we do all of our code um merges through github pr so it's all out in the open you can see the awesome interactions between realm employees there hopefully it's above the belt from for the most part i think it is yeah realm friends and yeah and uh i kind of did a really quick calculation um basically of all the all the repos we have we've now got about 25 000 stars which is excellent and we've got i'm calculated more i went through just sort of a quick addition 35 000 commits among most of our major repos so there's a lot of work that went into these things and as you can see as you can see at the bottom well we have a c++ engine we then create we call them internally bindings but externally they're called separate products um so we have versions for swift objective c java xamarin and as of last last week we now support dot net core which means it now works fully on windows which is really exciting and that's the react native logo but we also do javascript in general including no j s on the server so realm itself is a very interesting type of architecture because it uses a concept called live objects so live objects is apparently a concept that happens that was discussed in the 90s or something like a long time ago but at the time the hardware wasn't very viable so people tried live objects but then they kind of did away with it but thankfully the landscapes changed a bit now and live objects became viable and realm is completely architected on this concept so i explain what it is basically the way realm works is there's no there's no copying there's no there's no we take the data that's on disk and bring it into memory it's actually what we call a zero copy sort of mechanism so when you're actually accessing data from your code we're actually using the memory maps features of the memory mapping features of the of the ssd or the hard drive to point to that data directly on disk and page it in on demand and this is really good because it means there's no copying there's no overhead for opening the file and doing doing a copy in memory which makes it very fast and was buffered with ssds as well that that gives really good performance even though it might you would assume there might be a bit of a performance hit but this also enables the paradigm which we call live objects because what this means is that because we're not dealing with a copy in memory we're still dealing with a copy on disk when the copy on disk changes so something else changes it maybe a background thread changed it or even another device changed it which i'll talk about later if that thing changes on disk your object in memory will also update as well which is really really cool because it means that suddenly you don't have to worry about doing like manual data refreshers refreshes it just means that you have an object in memory and then it will change on its own this is a really powerful thing when you get to get to realize how to use it i didn't use it in my comic app because i didn't know about it back then so i'm still doing manual refreshes but but basically what this means is you don't have to write any management code at all it's really really powerful so just a bit of a since we've got so many realm users here this show hopefully hope there's be a bit of a refresher the rumble mobile database has basically four categories that make up its api for the most part basically you can take each of the apis and each have a series set a set of set of responsibilities and we can go through and talk about what each set does and all this makes up the the lifecycle of data persistence in realm so the first thing is objects so other databases like sqlite treat data as rows and columns in a table so it's a it's a very it's a very tabular relational database style realm is not like that realm is just objects so the data you deal with it as objects in your own code and it gets saved down to disk as objects as well and this is really good because it's because there's no conversion or translation involved this is part of the reason why we can do use the live objects sort of paradigm and what's even more excellent is um with sqlite you have to manually define your schema ahead of time you have to see if the database file exists you have to go okay the database file exists but there's no table there so i have to create the table i have to create the schema i have to say create column name with varkar 32 and things like that because i think that's how it still works i haven't done it in a while and obviously that takes a lot of time and you've got to you've got to really manage that because if there's no schema then you won't be able to write data realm is kind of back when i found it discovered it back in 2014 i was like this is crazy how's it do this it uses dynamic reflection from the from the um the platform it run from the runtime platform it's running on to analyze these objects determine the schema based on the properties in these classes sorry not objects classes and then it can generate the schema the first time you open the app and it's really cool because all you as you can see here all you need to do is just just create a class that's a sub class of in swift it's a realm dot object but you can just just say object and java it's an actual realm object and then realm is smart enough to go okay so let me just get a list of all the object subclasses in this code work out the properties and then the realm file on on disk will then have these properties these schema automatically generated this is really cool because it means it's zero setup on your behalf this is just i just write the classes and i'm done and that's just that's objects so next thing is let's assume we've added some objects to realm now how do you actually get the data back out of the realm file so we work on it on a really sort of like simple but chainable query system which makes it very simple to get all the objects of this particular type and then filter it down to what you want and then if you want after that sort it as well and because realm is live again and lazy loaded you can do things like this where you you say from the realm context get all the objects of type dog and that's actually a really light operation because we're not we're not pulling any data and we're actually just just getting a reference to each one and we'll pull data and if you access it but if you don't then that's a very light operation but after that you can then say of all those objects apply this filter which is see if the dog is a puppy which so it's ages less than two and so that will take so that that will make mean that that puppy's object we've got now and it's been returned is a it's called a realm results object and that is a live introspectable snapshot of all the object not leave a snapshot a list of all the all the dog objects with the edges lesson two and the cool thing is this is something I did not know about for for the longest while and this is this is so cool is um that query results object is also live so if you go ahead on a background thread or somewhere else and do something where you might add another dog that is also a puppy has an age less of two or a dog has a birthday and it stops being a puppy something that would change the results of that object realm will automatically update that object there's no need for you to refetch it and redo this query you can just hang on to that puppy's object basically for as long as your app is open and it will automatically and intelligently update itself with the current state and again this is really really powerful because all you need to do is basically do one line of code to get the list and you can just attach it to a table view or a collection view in ios and basically that object can be your data source but that being said we now have an interesting situation how do we know when a when a query has actually changed and and the data has actually changed so how do we how do we know that we now have a need to update the UI back when I started realm we didn't have anything so I had to implement my own notification system I was like a dog was added on the main thread but thankfully realm has made leaps and stripes over the last two years so now we've actually integrated an incredibly rich notification system which has lots of granularity and you can do things like register for any kind of event that when data in the realm changes you'll be notified you can update your your UI and the granularity granularity goes from all the way to the very top so you can you can get an event every time anything in the realm changes all the way down to a specific property on a specific object so if you have a view controller that's showing all the properties of a single object you can you can register for every single um property to change and then update just the section of the UI where that's actually um being rendered but probably the most important one we have is um clearly when you talk about table views and collection views you want to know that if a new object has been added or if an object's been deleted because you have to update the number of rows it's visible on the screen so it's a very very straightforward API all you have to do is take that original results object we had and add a notification and call the add notification block method on it and that will let you that will provide you with a closure or a block that lets you that will be called every single time something changes in realm that would cause that query to change and it's really really cool in the fact that it returns this little changes object and in that that actually gives you granular data about what happened so was an object added was an object deleted was an object with the properties changed the name change or something and because of that you can then plug that straight into the UI table view API so you can actually get really granular animations like you don't have to keep constantly updating the entire screen you can update just a bit that needs to be updated so you can have really efficient UI updates at at basically zero code it's very very minimal code cool so and the last thing I skipped over it before I just said let's assume we have data but actually putting data into realm so um I go back my notes from the previous slide there we go so realm realm is acid acid compliant which means that it's very it's very particular about how data is added in such a way that it's very very transactional there's no possible way that data can be added on two different threads at the same time because that would cause corruption and corruption is very bad for a database so it's it's it's it solves this problem by integrating and implementing a very strict um but very straightforward right transactional system so when you're used to other things like like core data where you can technically change properties about doing a right but you do sometimes get funniness um this is really good because it gives you it gives you a lot of context and lets you architect your code in such a way that it's very straightforward to perform right transactions so to do a right transaction as you can see it's um a little less code in the script side but it's basically the same you always have to do is open up a right transaction on a route so that realm object there is just pointing to a realm as a context for a realm file on disk just say realm dot write open up a block or alternatively you can also call realm dot begin commit begin right transaction or and then afterwards realm commit right transaction and that means that everything in between that when you when you set the property there it will then be added right written to realm and something to note is on other threads you can still continue to read from realm while a right transaction is open which is a really nice mechanism because you can still do heavy background processing but you cannot have two right transactions open at once so if you are doing a right transaction of one thread and another one that's executing at the same time opens up on another thread that second one will wait till the first one's done because of this we sometimes recommend you you be really careful about this because you could you could if you do uh writes on the main thread you could end up in a scenario where a back a long running background right on the back on the background might block that main thread one so you might get um a block UI thread then so it's usually we usually recommend that wherever you can you try and offload all rights to background threads but as you can see it's it just depends on your use cases cool and that makes up the four categories of the realm mobile database and as you can see it's very straightforward there's not a lot of code we we we we we pretty much fight tooth and now to keep the number of methods and apis as minimal as possible so we're very dedicated at realm to making sure that when we add a new api or an object it's a big deal when it's totally necessary the whole goal is to keep the api as absolutely minimal and compact as possible cool so the new hotness we announced last year just about a week before i came over for ios confess g was um something we now call the realm mobile platform so this is a i don't know how to describe it it's not really a separate product but it's it's more a series of extensions and additional software services that go hand in hand with the realm mobile database that then really give it a lot more capabilities make it a lot more powerful enable a lot more features which is um a really cool thing and enables a whole new suite of new functionality so the core concept of the realm mobile platform is it is automatic seamless synchronization between devices so the concept is i'm a user i have an iphone and an ipad i have the exact same app installed on both iphone and the ipad i do something on my iphone like i it's a to do app and i add a new item and i just want that to like and as a user i expect that to appear in my ipad automatically so we seem to have entered this this period now with with thanks to i cloud being so easy to use and google doing google google app engine and and even firebase we're at the point now where users just assume that data is ubiquitous so you you put you put data into an app they just assume that even if they delete the app and reinstall it the data will still be there like clearly this is not the date this is not the hard drive anymore the hard drive is the cloud and these are just windows into your data so as developers we all know that's actually a really hard thing to do you either use a third party service like i cloud or um firebase but then obviously you're you're tied to a specific platform and again it depends on the platform but it could also be a lot of code or a lot of debugging or it might not fit your use case exactly and we at realm think there's a better way so the cool thing about the realm mobile platform is we take those concepts i just introduced with the mobile database and we just extend it slightly so if you already know how realm works with the live objects concept um learning how to use the realm mobile platform is incredibly easy again it's a custom c++ engine so as i understand it it is a separate like module that is plugged into the core and we also have several several other like daemons that run on servers so it's a bunch of extra software services but still c++ we launched it september of 2016 i remember it like it was last year it was good times um apparently the half the marketing team didn't sleep to get the website ready in time um they got a really good sleep the day after though something to be a bit aware of though is this one's closed source so for the time being i think there might be plans to open source it down the line but nothing analysis yet at the moment this one's closed source so we give you we give you a binary but we don't give the source code for this one but we do have um repos available if you want to give feedback and report bugs we we we still provide all the github um as much as the github niceties as we can and because of that we have three editions um but for most people here i'm sure that the free edition is the most important one um and i'll talk about what the editions or the difference of the editions are but just to let you know there's a free version that's it's ready for shipping it's production ready and you can you can start using it right away so this is well before my time but i was told when i was over in san francisco this year that real-time data sync has been like on the on the on the cards for realm ever since the the two co-founders got together they're like they they said from the beginning the database is step one but real time sinkers is really step two this is where we want it to be we want it to be a database that isn't just on one device but can just automatically be a shared ubiquitous ubiquitous database that that is across every every user's own devices and saving data should be seamless and as easy as just saving data to the same hard drive is that wind was it was that fan okay sorry i was like oh boy that's blown out of storm outside okay um cool okay so the core architecture of the of the real mobile platform is not too complicated so as you can see we've got the real mobile database still running on devices but what we've got now is now we have a piece of software that runs on a server somewhere it can be it can be a laptop we have a mac version can be an aws instance it can be a digital ocean instance it can be a what's the microsoft font an azure instance and you just run run that run that little thing there it's called the realm object server and this is that this is the piece of software in charge of managing the synchronization and then after that all you need to do is when the when the app starts up on the device the user can log into their own account i'll talk about log in a little bit and then once they've logged in two devices from from the developer's perspective all they need to do is just keep using realm as is so just saving data to disk and then receiving registering from notifications when data changes and the cool thing is realm does all the synchronization in the background so there's no there's no foreground um no foreground kind of like code you have to do it all in fact the only thing you really get at the moment is you can you can register for a little block that will tell you when a synchronization is in progress but for the most part it happens completely concurrently on a background thread that's completely managed internally by rom and so why why are we doing this what is the what is the uh what is one of the motivations behind this so up until now we want to move data between devices let's say i have an iphone and i want to save it to move it over to an ipad usually what the traditional model is is to use a rest api so the idea is we have the data in a local store on a device we send it up to the server by converting it to a format most cases it's json but there are a few other ones which are a bit nice and json but for the most part it's traditionally json the server then you know grabs the data converts it into its own format saves it to a database and then the same process happens in reverse on the way down the problem is in a perfect world that's pretty straightforward it's just if i'm a device that wants to get data from a server all i have to do is request users get the days on get the json and then update the ui problem is this is not a perfect world and any number of crazy things could go wrong and it could result in like a failed a failed um data request things like if the if the if the phone isn't online at the time or if it loses connection midway or if the server returns a weird a weird code because something happened in the server it turns like 404 or 403 or this or the or the json request work but it was the wrong json spec so that the app was expecting this json to be in this format but the server returns something different so suddenly you've got incompatible data and then the the app doesn't know what it's looking at you could also get things where maybe the json was corrupted in transit so you got half the json so you've got enough json there for the the app to start doing its thing but then it hits an unexpected uh lack of a closing bracket and that that could also cause things issues the problem with all this though is this is something that you have to worry about when you're an app developer you have to make sure that any nut for any possible thing that could happen when you make a rest request you can you can gracefully and intentionally handle what happens and make sure the app doesn't crash because obviously the end results if the app crashes that's that's a terrible user experience so the the whole point of the raw mobile platform is to try and issue this concept by making the whole stack a lot more simple so the reason why all this json is necessary is because the way data is saved on a server is different to the way data is saved on a device when you actually want to push data up like i said before we have to get it out of like sqlite and you have to convert to json and the server has to decode the json to save it to its to whatever it's using which could be postgres could be my sql it could be mongo db it could be anything like that so it's complicated because there's so many different languages involved but the concept of realm is we've just basically taken the same concept of having a database on the device and put the same database file on a server so now all we have to do is just transmit what changed between the two databases between the device and the server so suddenly we've cut down a lot of cruft there's no need to do any json encoding there's no text it can even just be binary data because there's no need to have any um user readable um information there so this this is really nice in the fact that now we've um we've completely drastically simplified a stack which is which is more efficient a lot faster and what's smarter at how it works um but that's the tip of the iceberg so all i've been talking about at the moment is i have two devices and i want i want to i want to synchronize one data from one device to another and that's pretty easy because data data is raw and can be mirrored very very easily but the cool thing about another cool thing about the roll mobile platform is we also expose that data to other services on the server so for example how to explain this so we provide two mechanisms we have event handling and api bridging but what that basically means is with event handling for the most part you can write some code in your and deploy it to your server that will be executed every time realm detects something changed so for user my favorite example of this is a user might be using the mobile platform in a chat app so they're writing some messages you can get an alert whenever a chat message has been uploaded and then you can do you can actually get at that data and and modify it so you can do things like filter out profanity or if there's url there you could act on the url and send back some url metadata to have like a live preview and things like that basically this means that this opens up realm to the point where you can actually start implementing your own business logic on it you can actually start doing custom things of it which is really really really powerful which is excellent and another thing that we're looking at at the moment i'll talk about in a little bit is a data connector so the concept of the data connector is without needing to do business logic because all you need to do because all we've got is two databases you've got your own your own backend database and the realm object server you can actually just mirror the data between the two databases so just ensuring data parity so you can do and you can do this all automatically i'll talk about this in a little bit but the concept is we're working on a piece of software that can automatically handle the data synchronization between databases on the server with the realm object server the idea being if you already have a pre-existing database you can then just mirror it to realm very very quickly and easily so three additions like i said the main one is well the big the biggest one is the enterprise one for large-scale organizations realm itself is really really efficient with one instance we've managed to gauge you can get up to 10 000 concurrent connections and that's that's not 10 000 users that's 10 000 connections at the same time but for instances where you are you're running at a scale a lot bigger than that we provide an enterprise version that comes with all the features all the scaling and backup features that you need for your user base of that size every professional one which is good for smaller startups who are getting off the ground this one gives you full access to the data on the server so all that event handling i just mentioned and the developer edition is for indie developers so people who just want to ship an app and have data sync without having to go through another one of the services we don't give you full access to the data but we we've given enough data enough access you can do pretty much anything you'd want to seriously so i've got a few app ideas now i'm kind of excited about for um access to the data on the server but i'll i'll talk about a little bit about what you can do with this and how it works for the developer edition cool and just just one final quick quick thing obviously we comes a lot of features like i mentioned before realm is offline first when you make a right to realm it gets safe to the disk first and then once it's safely on the disk that's when it gets synchronized up so there's no chance of if if the the signal goes out or if the battery goes dead there's no chance of the data being corrupted or lost because it was mid transit there's always a copy on disk first so it's offline first by design like i said we've got event processing so you can actually respond to both on the device and on the server when when something changes and you can you can perform additional business logic for that real-time two-way data sync like i said it's between the object server and devices it's very straightforward and it just sends pretty much just the deltas between the two api mobilization i had to figure out what the marketing team meant by this one what they meant was when you when you integrate an api like a like a third party server straight into an iphone basically you're tied to using that api exactly as it is when you ship but if the api changes down the line like if it becomes incompatible you the app will stop working without shipping an update that fixes the api the point of this one the point of api mobilization means that you can then rely on the rom object server to get the the bulk of the traffic up to the server and then the server can be responsible for those api interactions so if the api does change or the or the api has more features that come out you can actually rejig your server logic and then continue piping the same data down to realm which means that you can actually modify api's on the fly without needing to to ship a new update to the app store or the play store oops oops daisy i went ahead too far okay what else is there authentication this is a really cool one so we give you out of the box a basic username and password signup system but if you want to use your own you can there's actually a plugin mechanism where you can add any user system you're using already i believe that there's documentation up on the server about it but basically what that means is if you already have a database of users with the username and passwords you can just plug that into realm and use that instead of making everyone get a new a new username and password encryption so it's off by default but if you need to route the data in a realm file can be encrypted with aes 256 which is a 64 bytes encryption key which is more than enough for health data regulations we've discovered so if you need to protect the data on the on the device so if that if the summoner measures to extract the realm file from a device it's still encrypted they can't get at it and when it's in transit you can use the traditional htbs tls encryption certificates to to make sure the data is properly encrypted in transit real-time collaboration as we as we um as we outlined before because it's very very quick there's even we've even got a video on our website of two people drawing on the same canvas at the same time because the data is so light and can be can be synchronized so quickly you can't actually enable real-time collaboration i believe the algorithm that's actually being used by the mobile platform is derived from the same one the operational transform that google docs uses so if you've seen a google docs of two people typing out at the same time it's basically the same concept and the last two enterprise level features that you don't really need unless you're actually really serious about having tons of users provide mechanisms for running multiple instances on multiple instances on separate server instances so if you want to have horizontal scaling that's very straightforward and the developer and professional edition allow for manual backup so you can easily do a cron job that automatically grabs realm files periodically to make sure that you can restore from a from a a crash or anything but the enterprise edition also gives a continuous backup mechanisms that will do that automatically but you can do that on your own pretty easily straight um without that cool okay i've done a bit of slide talking now i've got some demos here to show off just to show how it works so i'm going to pop out of the presentation really quickly and show you some sweet demos hopefully not hopefully everything's still recording sorry it's still recording yep so i'm always scared that like the iphone will try and be clever and we'll just stop doing what it's doing um because i've noticed that like recordings will stop if you've got live photos because it expects like if live photos are going like it'll it'll like it'll like overtake the audio just for that okay so the first the first one is called realm content this one's really really cool this one's brand new my my my great colleague um marin who lives in Barcelona um wrote this one and put up really recently so the concept of realm of realm content actually first things first i'll explain what it is the idea of the app is if you have a use case where you have you have a a lot of information you want to display to a user but it's ostensibly read only information a good example of that is maybe a shop catalog so also and to to clarify it's also um information that it needs to be updated regularly so for example like a catalog so you have things like stock prices if something goes on sale the price needs to change if it goes out of stock it probably should come off the thing things that need to happen so rapidly that that you can't really bake this information to a realm to a to a to an app and then just ship updates to the app store whenever you want to change it so the cool thing that marin did here was like he created an app where it's basically a blank container and all the information that is displayed in it is stored in realm and it's stored in a synchronized realm which means that if you want to change it from the realm um from the from the the internet from the realm from the realm object server you can another good example of this i think would be a conference app so let's say a conference is coming up i don't know if there are any conferences coming up but um and you have scheduling and you need to maybe change some um change some slots around or if like a sponsor pulls out or a new sponsor comes in and you want to update this about how they keep shipping new updates to the app store that's a really interesting concept you could consider if there's anyone here thinking about anyone or no no you know why i said demo this one cool so um i haven't got what i'm actually got internet here so i'm going to show you something really cool i'm going to show you how to run a server off this laptop so you don't you don't even need to have like a server running somewhere to play with this you can do it all completely from your laptop so i downloaded the realm mobile platform which is realm mobile platform dot zip and we can zoom in or i someone try zooming in wait it's just realm mobile platform dot zip i put that in my hilariously massive projects directory i need to clean this out at some point um it's in there somewhere there a lot of folders start with the word realm in there so and and the great thing is we ship a macOS version which is just this is a simple folder just run this command it will crash oh it won't crash it did crash give me one more try one more time is that working uh oh it's not working okay um give me a sec i'll re-extract it first comes to us i've got it i've got an online version and a soap here just in case realm mobile platform uh projects that's better it's more stuff in there there you go that's better there you go that's better there you go cool sorry it's just a good it's just running the realm object server in my in my little um terminal here when you open up for the first time this is this is so you can see that there's actually activity happening when it opens up the first time it'll say create an admin account so you can manage users so i'll just create admin at realm.io and i'll say the password is password i hope no one actually makes their password password because that's bad all right there we go and then we have a dashboard so they can actually see this is really cool because now you can see how much data is coming in and out how many connections are live how many realm files are open there'll be a few realm files open now because this itself is powered by realm and yeah so we'll uh and now we'll create so there's no realms yet so no users have signed in yet so you cannot users can either register themselves but on the admin you can actually create users as well so i'll just create one called content this this will be the user that will be that will be logged in for um the content app so create open it let's chase on being funny cool and now i can even share it to this ipad mini here by going up to my wi-fi and saying create network we'll call it tim's macbook pro if i work and i can actually start running it now so i'll go back to let's say go back to the code and i'll explain how to actually log in a little bit later but the crux matter is all i need to do now is just have this local host actually i'll sorry let me let me change it so you can actually see what i'm doing large there we go that's really large okay cool so marin took the took liberty of adding some constants at the top so i'll explain how the api works a little bit but the crux matter is whether we have the host we have the username and we have the password so now if i run that in the simulator hopefully that will not complain about swift being incompatible nope it's all good cool the same time i will uh i just realized i'm actually oh no that's fine that's okay i realized i'm recording the screen but i can also do a movie recording as well as i'm recording the screen only downside is you have to look at my horrible face for a second ah there we go all right there yes there's the ipad here's the ipad on my table so hopefully it should be matter of going into the wi-fi and hopefully there it is tim's macbook pro cool there we go so now i'm connected to my macbook pro from that so that's really cool isn't it if no one knew about that this is a really neat trick and so while local host works in the simulator it doesn't work when you're using another device so i have to oh there we go hold down alt when you click down on the wi-fi icon and you can get your device's ip address 169 254 try to remember that 169 254 everyone else help me remember the last two and 88 142 cool thank you that was right yep okay cool okay so now if i deploy that to my wait no that's right 169.254.8 oh you're right thank you wow you got better eyesight than i do okay cool i'm wearing glasses as well how embarrassing cool okay so that should work so now if i run that on the ipad actually first things first let me just delete the old version just to make sure there's no um so i put on this one oh i haven't run on this one okay that's good yes okay so if i run this on the mini and put a record this is what it looks like so if i blow that up i can put that up there we go so it's basically at the moment it's just a lot of like the cool thing is like every single thing here is dynamically generated by rom so there's no there's no um oh this is sorry there's no like standard like containers at all being set up basically every single object here is a dynamic object in realm which can be deleted and a new one can be added and so i can work i might not work that's oh whoops i know that's screwing up give me a sec i tried to be clever and i tried to add ipad support but it didn't work there we go so we just a bit of live coding there we go cool i'll do it and i'll revert back to the content that's what it's there iphone only yep that's good let's try that again so this works a bit better um yeah so while it's still combined let me show you let me show you what else is cool so like i said earlier i work on a tool called the rom browser this is a macOS app that lets you and we're working on a Linux version of windows version right now that lets you view the contents of a rom file which is really really you call for our debugging purposes and for just making sure data is being saved in the right spot we when we launched a mobile platform we also added provisions to let you um thank you for that to access realms on an object server and you can actually even edit the data from your your laptop to a rom file that's on a server so okay i'm going to quit it because obviously it's trying to do something clever there we go try it again there we go connect object server so the address is realm slash slash local host and by default we use 9080 as the um as the port that's correct that should be password so hopefully there it is cool and you get a list of all the realms on the server now we have one which is the the content realm and there we go so there's a so the app by default generated some test data on the first run but as you can see now we actually have exactly um all the all the content in this app can't really is that easy to see some of the key command to blow up the window is it oh there you go found it yeah it's here so let me see if i can bring this all together so this is really cool because everything is live um so marin took took great great expense to um to a great care sorry to make sure that everything's live so i can i can say i can just do things like this i can say change about this app and straight away that just went to the object server and then to the simulator and then once this works it would if this is on the same wi-fi or go to the ipad as well as you can see it's that simple and there's not much code because all of this is a result objects with a notification block attached to it and that's it is that going to work oh it works and it stopped working story of my life okay there we go it's like my my favorite my favorite programming poster is that one where the guy is saying my code isn't working i have no idea why and the next one is my code's working i have no idea why all right it starts again there's the window can we see cool all right let's try that again oh no we have a what oh that's why oh i didn't i didn't sign my tests so i can't run the app okay thanks for that xcode i'm sure i had to sign my tests but okay okay cool there we go that's better couldn't connect to oh whoops now i have to change the thing back um uh right when i rolled back the um commits that also deleted the ip address all right let's do that again what was the address it was 169.254.3 a3.144 i think that's right is that correct oh yep thanks username password is also wrong just in time there we go all right moment of truth see i was gonna the app was only designed for our iphone at the time i was gonna try and stick a us bit view controller into it but i found out that's actually actually more than you need to because you have to like sometimes like fine grain manage the view controller stack and that thing cool there we go so we've got oops you guys uh okay that's interesting clean list there you go cool so let's try that again sorry we've got um default page heading of h1 there we go so what was that what was that where was that i lost that formatting showcase oh there we go clean list for me there we go so now we actually have so the the simulator on my my laptop and the ipad are both connected to the object server running on my laptop now so let's see i didn't actually test this i hope it'll work the way i think it'll work it's a heading of h1 it's a hi everybody yeah there we go as you can see oh that one that one didn't okay but the okay maybe have to rerun the simulator but the um the one on the ipad did that's interesting it's probably because um i tried change that p address potentially let's try it again basically that's basically it so the concept is um you can just change data and and you use the same mechanisms that you would have implemented for updates happening on a background thread to come down over the internet which is um really a really quick and a really intelligent way of going about and doing it that's interesting how's it how's it doing that all right maybe i have to delete this one too actually that's probably what it is the thing is if you can't it's not really great at um let me just delete both it's not really smart at handling if you change the server out from under it so i was testing this one before on a live server somewhere else and now since i swapped it to a local database it um obviously decided to be a bit cheeky with me see this works but i think you get the idea all right try it again plain list plain list it's empty okay the data got host okay interesting date whoa i think i think this apple so assume there'd be a slight bit of internet but i think it's okay okay so open that up again there we go same pile oh i see it hi everybody there we go okay i see what happened so there's some logic in there where it's resetting itself every time you run the app like i'm guessing this is for a demo for demo purposes go back you see where the store capital yeah so that basically gives you the idea the idea is even the realm itself is just acting as another client so you've got um so it's writing to its own local realm far which is then synchronized to the object server which then comes down to other devices cool that's basically realm content um we've got one more demo and then a little bit more after that and we're done sorry the next demo is realm pop this one's a really fun one and um we we love to show this one off because it's it's it's a game it's cross platform um it nearly ended some friendships at one point um yeah it's a pretty pretty hardcore game um but yeah let me let me let me crank it up let's see if we can get it running on on the local instance all right so see me just properly so delete that i'll show what i'm doing so first things first to make sure we're not got we haven't got any data in there that's assuming it's online we'll just delete the two instances from the simulator and um the ipad it's open it's already open that's why it's not opening okay so we'll do this one as the same ip address uh let's just copy and paste where's that ip address there it is so copy that i'm gonna make another user we'll make that one so go back to the object server in this in safari make a new user call this one pop same password is password super secure cool okay and now if you go back just copy that put it back into oh it's in pop yep it's good cool so run that on the ipad and run that on the simulator cool so it's it's loading up cool that looks like it's behaving it's still burning oh we have to throw it fast at compiling everyone having a good time yeah cool excellent so actually how many users can do a real time so we've we've read that one instance can go up to 10 000 concurrent connections so that's that's that's 10 000 at the same time sending data back and forth the server oh come on there we go oh there we go what's the building it's building this amount is equal for all friends i mean for enterprise so enterprise gives you the ability to horizontally scale so you can then add more add more services as you need but um we're relatively confident that if you if you managed to get a device that start an app that's so successful you've got 10 000 keep in mind that's not just general users that's that's number of users on at the same time so that's 10 000 concurrent yeah so mediocre uh server that uses three old time connection it's not something like a super huge amount no no of course not yeah cool okay cool something simulator let's see this works with one ipad let's see if we're at the same time there we go okay hopefully this is working ipad cool that's right i just remembered i need a volunteer someone to volunteer desmond come on desmond everyone welcome desmond kark desmond's an old friend of mine we used to we used to present it at the same uh conference in australia all you want me to do cool you can be this this this gamer i'll be this gamer um i'll beat you you're probably gonna be me i'm terrible at this game so yep so you often yep you invited me to play so i have to click accept i'm in the simulator sorry the way this works is there'll be a bunch of numbers on the screen whoever taps the numbers in the right order going down wins if you tap in the wrong if you tap in the wrong order you lose and if you're too slow you lose granted i'm going to just manage so okay it is stuff on the biggest one yep the biggest one yeah i went whoa that's quite close though all right one more oops we'll do another request i'll request you this time so you hit yep all right here we go all right oh that's right 21 21 is higher than 18 all right again all right one more best of three i haven't made a disadvantage here for the record uh come on you silly mouse there we go there we go good game yep there you go thanks desmond never give a round of applause to desmond let me drag him up here cool so that's the concept of realm pop and um i believe my colleague up the back uh zucky has copies of it on android as well this thing is cross platform as well so you can actually crank it up one iphone one android um and it's really nice because it shows some um it shows you can use realm to manage game state which is a really good thing for um um if you want to make a game really quickly but also uh with with event handling you can even do things like you can tally up scores and and create like leaderboards and things like that as well um oh yeah i was going to show you really quickly how how all this works so it's actually not a lot of crazy code it's actually a terrifying small amount of code so to actually get realm running through the mobile platform in your app it's all that code right there pretty much which is kind of crazy so let me just walk through it really quickly so that we so marin created a functional connect and we've got the credentials here so you have the server i address address which in in real life would probably be a domain name so you could control the ip address from the background from the background uh usually what would happen is the user would provide their own username and password but in these demo apps we can just create a test user and just put in the credentials right there and then all you have to do is before you start reading from any realm file sorry you just you do you perform what's called a login operation so you create a sync so to use realm's default um default username password system you create a sync credentials objects and you use the constructor username password and all you have to do is put in the username the password and we're particular about this if the if the account already exists you have to say register equals false if you do register equals false and the account doesn't exist it will not automatically create an account this is done for security reasons and so that's that's it so you create a cred credentials object and then it's just the static method here this is a realm i'm realm method just say sync user dot login with cred some some credentials and you set the ur at the server so interestingly enough what we do is we actually set it up so the server can the server you use to authenticate can be different from the server you use to actually connect to do realm stuff to do the realm synchronization this is so you can actually provide your own authentication mechanism so if you want to have your own username database you can run that off a completely separate stack that does the validation and just as to come back to realm and say to realm yep that was a valid user and that's just an asynchronous request once it completes if it doesn't fail you'll get this user object which is basically a representation of a logged in realm user and then it's really crazy after that so if you've used realm before you'll know that we have what's called the realm configuration object so when you create a realm instance you can use this configuration to set up specific things like where the file is on where the file is in on disk or what particular types of objects this particular realm file will manage if you want to just hold if you don't want every single object from your your app to be put in there as of when we launched mobile platform we now added an extra property called sync configuration so it says configuration dot sync configuration and in there all you have to do is put in that user object that you that you are received but you can also it's also saved as a static property as well so you can say like you can even call sync user dot current user and to get that same user object and then you pass in the URL to the actual realm object server so in this case since we're using our own I believe it's a TCP it's a specific protocol that we've called that we've we've yeah we've developed called realm so it's very easy remember so you just you you create a URL with the realm protocol prefix by default the port is 9080 but we put we cover this in the documentation and then we even have a mechanism we can either have a public realm where all users can read from it but no one can write to it we have a private realm so it's a realm just for that user in which case you you put in this little tilde here and then the name of the realm so now that we played that on locally if I go back to the the realm browser you'll see the game appeared here so this is this is game and that that string in front of it is the user ID and that's what is that's what that little tiller there is is um is it total or that squarely thing I don't know the name of it is is um representing so now if you actually open it up you can actually have a look at the uh the humiliating thrashing that Desmond gave me um as you can see we've got the players and we've got the number of games we had we even have the record of let's see if we can zoom that in record of who the players were what the numbers that were given who won on each side in one amount of time um you know really great stuff for me to look at um and yeah all right and I'll try and do one more thing just to see if this might not work because it's still in beta but I'll show I'll show you just in the off chance it will work so in the developer edition you can actually get the realm the realm data if you want to do your own event handling through this new feature we brought out very recently called realm functions um I got to make the launch video for that and realm functions basically gives you a full blown javascript editor inside um your browser and you can actually use this to to perform your own um logic when something in that realm file changes so let's see if this works so so all we have to do here is creating your own even even the sample code that comes in is really good is is really usable so the name of that realm was game I'll just look my new script and that's it I hope that's just a matter of start oh there we go and straight away it works so as you can see now so now as you can see what's happening is as I'll do one more game but I won't um oh thank you thank you calendar um I'll do one more game and hopefully what we can see is as we're playing you'll start seeing stuff updating in that console yep yeah so I'm terrible at this game um but as you can see as I was as I was working with that we actually had the um the actual data come through inside our browser so now we can actually write our own logic here to get that data we can modify it we can move it to another realm we can attach another api um one thing we actually um use in one of our demo apps is we actually plugged in IBM's machine learning api so you could upload a photo through realm through watson and watson will return the description of that photo back through through realm again um and that's completely doable through the realm functions cool that's really powerful I've got a few app ideas myself I want to um I want to try with that when I got some free time eventually cool so there's two demos go back to that turn that off we have a lot more demos a lot of my a lot of the stuff I do nowadays is just we we create a lot of demos just in in in terms of trying to come up with scenarios that people would that potential clients or just general general realm users would would want to have so we can show how it works and show some particular architectural models and things like that so I just mentioned realm scanner you see my mouse here so realm scanner was one where we use we use um we actually use the event handler but it's doable in realm functions to um to use realm as a mechanism to send data up to IBM watson we also have logging kit which is my pet project where I've I've created a a full-blown login view controller so you can enter in your username password for realm really easily if I have to manually do that yourself we have we have all these demo apps down here at the bottom well it's a storm outside again no um so I we can show this off tonight if you want we've got realm puzzle realm tasks and realm drawer these these ones are just really quick quick um fun ways to show how how some some of the applications of the realm bubble platform and yeah and just one last thing really quickly this is this is um something we started adding recently now that we've actually had a few more um clients sign up with us um we've started learning that there's a lot of challenges not challenges but like when when integrating realm with um existing backends sometimes it's tricky because we can we can guarantee like synchronization between device and the object server but then there's always the integration with the back end server as well so there's um a lot of a lot of people trying different things and we found a few few that stick so I'll talk about them really quickly but obviously these these are um changing over time so we've come up with four design patterns that we like to talk about the most at the moment so the lazy fetcher the polar the dqr and like I mentioned before the realm data adapters so I'll grow this really quickly because this is this is kind of stuff that um you can come if you actually do want to learn more about this you can come and ask us and we can talk to you about in more detail but this will give you a bit of a taste of what what what we can what we've been considering so lazy fetcher is basically the model that we used for the scanner like I was mentioning just then the idea is and even api mobilization as well the concept being that you have an you have an existing back end api it could be yours it could be someone else's it's just out there and um you need a way to trigger it so you what you do in realm and what what we did in scanner is the the model we recommend is you create what's called a fetch object so it's just a special it's just a normal realm object but the point of the object is its presence acts as a trigger so basically it's like an object of an object that represents a request so in the example of realm scanner when we want when the user takes a photo of something realm will create a new scanner fetch object and will put that photo in as ns data or just data and swift and that will be sent up to um to ross up to the realm object server and then you can use the event handler to say okay that's a request object that means the user just wants to scan this picture so then realm on the server side can then forward that up to the the back end api and then once you get the response from that it's really neat and in the fact that you can just write that back to the same object that represented the request so basically you can put the response in the request and that will come down automatically being synchronized by realm sometimes you might have an api that doesn't have any notifications like not any way to notify when data changes so one thing we started recommending and we found out is really effective is while while doing polling on a device isn't great because obviously it takes battery and processes cycles on a server it's pretty reasonable so if you have an api where data might be changing but you have no idea finding out it's not unreasonable to try say if a polling mechanism either in javascript as a node process or even just as a cron job and just periodically checking that api to see if something changed and if it did then you can actually fire up the event handler and then add that data to realm and then that will then synchronize down to user devices and the third one to de-cure that's basically the same the same as the lazy fetch button reverse so the the api itself will then create a series in queue a series of tasks that realm will then take first come first serve and then process them it can do it on its own in the server and then if it needs to send data down to the devices it can the concept is the api itself creates a series of um pending tasks that that is then offloaded to realm and then finally like I mentioned before the realm data adapter if you have a back end service that doesn't need like business logic like we're talking just a database like it's like a postgres well these postgres as an example a postgres database and you just want to be able to access that data from realm one thing we're working as a sort of a side project is the concept of data adapters so what this means is um there's no there's no logic there's no like business logic in between it's basically if a right hat if a right occurs in your back end database that data is mirrored to realm and vice versa if realm does something it gets mirrored to that database as well so there's no execution or anything it's just basically ensuring that data is mirrored between the two containers so we've we've made one for postgres now which is working really nicely so if you add some data to a postgres database that can that can automatically be propagated to realm and I think we're looking at other databases soon probably my SQL is next I think but don't quote me on that cool sorry in any case please try out the developer edition as you can see it's just a download just download it open it up unzip it start start executing it and you can play with it straight away you don't need a server you just need to be on the same wi-fi for the most part and if you don't have wi-fi you can you can just turn your own macbook into a wi-fi hub and that works just as well as you can see you just hold down alts to get and click on the wi-fi icon to get the IP address if you want the professional edition is also available for download there's I think it's a 14-day free trial but you can try all the all the features out and see if you like it we'll see if you can if you can benefit from those features or if the developer edition works just as well and if you'd like to learn more about the enterprise edition there's you can come talk to me afterwards or there's an email on the realm website realm.io you can go send an email and we'll answer your questions as we can and just as a bit of housekeeping we're always hiring we need a lot of JavaScript engineers most of that stuff I've shown is just JavaScript so if you love JavaScript please come talk to us apart from that and we do local and remote I've done both now I've done local and remote and they're both good and yeah so yeah if you're interested give us a look out and that's it for the talk thanks so much to Singapore Power for hosting us it's so good to be in Singapore I hope you guys enjoyed it guys and girls enjoyed it at all and I hope you had a good time and hope you'll see you next time cool are there any questions hey yeah I have a question sure we saw this case when you have a application that synchronized all the data on simulator yep and the user opens screen and no no data there I mean it's one of the screens and there's no data we're waiting for synchronization okay what is the approach to fix it on real application for example I have a quite big yep okay yep so this was a problem that we we did we did discover that was actually happening quite a bit I believe it's in the Java version but it's definitely the iOS version we now have a we now have a method called realm dot async opens that will actually let you now actually notify you when the realm has done the initial connection when the data's come down so you can show some progress a progress bar so yeah I you might need to play with it but I think another approach should be you could also in theory use the the notification token like I said so as data comes down that will be notified saying so as you can see it'll come down as it comes down you can you can update the UI to show the bits that come down yep that one yeah it's definitely tricky because it depends on how big the data is if you are having like a long time and it's not a great experience come let us know we can we can help help you with a common approach when you have a server you have database it's quite simple you just request database oh no data okay I request server and they have data now and then catch but here I should wait and yeah okay I got it yeah yeah but if it's still a problem let us know but yeah try async open and or even just try try the normal the first one but using a notification block cool any questions hey yeah another question about the rules about sharing data between multiple users yep because people will open all users at the base for every user like everyone that's uh yeah a bit of a security hole yep okay so I didn't really talk about this much but we have a we have a feature called user permissions so why I touched on it briefly like there's a concept we can you can have a public realm that everyone can read from and it's synchronized down to every single device for automatically but there is also a mechanism where two users can share share access to their own private realms so it's a very similar very similar yeah to the five and but another yep sure well I got that question last time why the API is completely different um so realm java is a little bit newer than realm objective c and swift like it started a bit a bit later and it's done they're both done by two separate teams and and they're not even in the same country once in Copenhagen once in San Francisco so as far as I'm aware there's there's huge there's great effort and strides to make sure that the apis match as much as they can but another concern is just the way that the languages like java and objective c are two different things so sometimes they can't line up exactly but just because of the constraints of the language um but yeah I think I think there's definitely effort to make sure they're on par yeah I know I've I've I've fed that before I was like I see a stack over for a question about a java question like that's easy in iOS oh wait that that api doesn't exist in the java so uh okay no worries yep sure oh I switched me um yeah so that's um so in you took so what what what's being referred to is um in the dot in the dot filter um method you can use a string to actually filter your properties that's actually an ns predicate so it's actually using the ns predicate syntax so we support I think we don't support all the ns predicate syntax but we support like 80% of the major ones so you can do things like string matching seeing if if integers are a portion of a string is in a string um but you were asking if you could use in a block I think we we have that on the on the map that's definitely a feature request because people people want because that that means you can actually start doing things like like filtering and sorting to your exact specifications and so that's definitely been on the list I think I think someone was working on at some point so it's definitely in there but for the time being yeah that string is ns predicate so if you if you look up ns predicate and look at the syntax for that that's how it works yep at the front sorry yep sweep runs on the server right sweep runs on the server yep there's no realm that can work with sweep on the server believe me everyone on the realm cocoa team really wants realm sweep to work on the server but the problem is objective c doesn't run on the server and realm sweep is actually a wrapper around objective c because it's the objective c that can do the reflection features of the scheme of detection the first thing we need is we need swift to do c++ because then we could we can completely get rid of objective c and just plug in the c++ core straight into swift but for the time being because swift doesn't do c++ we have to use objective c still so down the line as swift matures um I know that the second it becomes feasible we'll probably jump on it but at the moment it's just not possible yeah yeah the swift needs to support c++ before we can start looking at that um yeah yes how do you solve the conflict between the two devices conflict resolution I always get that question okay so the way it works is um it's very intelligent in the way that works it only sends up data that changes so you don't actually have any um any like stuff in the way like so it only focuses on the stuff that changes and how it works um to my understanding because it's rather complicated is it it sends along not just the deltas it also sends along the history of what changed to get to that that that um that outcome so basically what that means is both devices send up their their data and their their actions that got to that data and then it performs what's basically a git git rebase on the server to say okay that happened that happened that happened that happened this is the final but uh data that should be the correct one yeah lots of code basically yeah but it it works really really well like we test it really thoroughly we haven't had any any um any unexpected um things yet what do you mean one version yeah yep yep and then they're both going the same time yep yeah right in that case I didn't write it to test it exactly whoever changed it last will be in terms of in terms of relative time whoever changed it last will be the one who wins yep yeah there won't be one copy on the server what if name one was changed last yep uh name was changed let's say name one was changed yeah five minutes ago name was changed ten minutes ago yep uh but name two came online updated the server and name one oh I don't know this is tricky because there's so many different combinations I I think it would actually I'm not I'm not going to try and guess that one do you have to have to try that one so is another question the question oh repeat the questions okay that question was asking about um conflict resolution so do you want me to repeat the whole question or okay no worries any other questions cool okay all right all right fighting gloves on all right how many android developers are here oh cool okay all right dare I ask it how many ios developers are here yeah that's more like it cool excellent so that was just for the record that was about a third android and two thirds ios cool any other questions all right well um I think yeah sure yeah for the room uh itself yep uh one way of server uh from your example the dog and the owner so when the yep one I have a table view and the I want to display the dog information and also the owner name okay yeah the way either the station uh will be either of them for the location of the changes of the filter right yep and uh in some other way we change the owner's name who it looks like the owner's name um I believe so I believe even if it's a sub object of of um of the object you've attached notify to that will still register as notification but I think we even had we had that we had that question on stack overflow today I think yeah but it should be it should be smart like the notification is smart enough to know that if something else changes that's in relation it will still trigger cool well I think we're here for a little bit longer but um so I think we'll leave it there but if you want to ask any more questions feel free to come up and ask them in person um thanks again everyone for coming I hope you had a good time um please feel free to tweet about it if you want and um I hope you see you next time