Migrate an App from MongoDB to HarperDB Livestream
Tags: javascript, programming, database, typescript
Published: 2022-02-16 20:02:37

###Don't Miss This Opportunity to Code with Lucas🚀 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/spm7uh43dnkc3a1ve2dj.png)
Lucas Santos, Senior Software Engineer and Google Dev Expert, demonstrated the migration process from a MongoDB database to a HarperDB instance using clients and SDKs. He refactored a legacy, layered app, showcasing necessary steps in the app like date conversion, UUID handling, and more. The core of this demo includes converting an application that's using MongoDB with an event sourcing architecture over to HarperDB, as well as details like passing operations to HarperDB, and using HarperDB's [Custom Functions](https://harperdb.io/docs/custom-functions/) feature. (Lucas uses TypeScript for the demo and Custom Functions are written in Node.js) 

[This livestream](https://www.youtube.com/watch?v=1F3kyNy7djM) is for developers and tech leaders of any skill level, and will help you strengthen your app development skills, as well as general database / data management knowledge.

###[Watch the recording](https://www.youtube.com/watch?v=1F3kyNy7djM) or check out the [written tutorial](https://dev.to/khaosdoctor/migrating-a-legacy-application-from-mongodb-to-harperdb-4cca) to code along.  
---
__Resources__
* [Github repo](https://github.com/khaosdoctor/harperdb-migration-demo)
* [HarperDB Studio](https://studio.harperdb.io/)
* [HarperDB docs](https://harperdb.io/docs/overview/)
* [API docs](https://api.harperdb.io/)

---

###Why migrate to HarperDB?

While MongoDB might be the most prolific NoSQL database around, there are certain cases that might be better served with another solution. Examples would be projects where you need both SQL & NoSQL, rapid app development, integration, edge computing, and distributed computing. Or, maybe it's just time to try something new! HarperDB is faster than other DB's in benchmarks, has a native REST API, supports SQL on JSON, and scales out of the box for concurrent operations.

__Livestream Q&A:__
_Why switch to HarperDB?_
Lucas Santos: I liked the way Harper doesn't only have search by hash, but you can actually [use tokens to authenticate](https://harperdb.io/docs/security/jwt-authentication/) in the database so you can completely remove the authentication layer from your app and put it on Custom Functions in the database. You can just generate tokens inside the database without having to expose that functionality. The other thing is that you can use SQL and NoSQL... most of the time I use NoSQL but I've had a lot of opportunities where I really wish MongoDB could support SQL, so the best of both worlds is amazing. 
 
_Favorite thing about HarperDB?_
Lucas Santos: One is the built-in functions, and the [Custom Functions](https://harperdb.io/docs/custom-functions/) is really nice because you can migrate a whole app inside of it. So if you have a small app that you want to spin up without hassle, you can put everything in Harper and you'll have the API and the database in the same place, so it's just one thing to deal with. 

---

###Meet Lucas Santos! Software Engineer & Google Dev Expert

[Lucas Santos](https://twitter.com/_StaticVoid) (@khaosdoctor on Dev) works as a Software Engineer at Klarna. Technology lover and, since 2011, works with cloud-native applications. Loves to teach and learn, writer of "Kubernetes: Everything you need to know about container orchestration". Granted the title of Google Developer Expert, Microsoft MVP, and Docker Captain who has been talking about technology for over 4 years both nationally and internationally. Member & Contributor to the Node.js Foundation, KEDA Project, and the TypeScript language. Also is one of the core members of awesome communities such as NodeBR, JSSP, VueJs SP, Typescript BR, NodeSchool SP and ABCDev.