How to make multiple databases in mLab MongoDB add-on in Heroku - heroku

I am using mLab MongoDB add-on free version in Heroku.
I want to make two sets of data bases(development, production). But it does not allow me to make multiple databases. Any possible solution to fix this problem?
The paid solutions seem to only increase store capacity and other few features related to monitoring

I have sent an email to mLab. The response is that it is not possible to make multiple databases with a single mLab add-on in heroku. Instead what I can do is add a completely new mLab add-on. But this would be cost inefficient and data cannot be transferred directly from one database to another.
The other solution they suggested, is simply to make mLab database using mLab account itself instead of heroku. Then I would be able to make multiple database in a single instance with a better pricing.

Related

How to sync database with remote database with Dexie

I making Notes PWA App that work offline and online.
I am saving notes records on IndexedDB with Dexie.js. I am using Quasar as frontend and backend as Laravel 8.
I want to sync IndexedDB Database with remote database. How can I do?
Look at Dexie Cloud - David has worked this out for Postgres.
If you want to write your own, it is a LOT MORE WORK than you think.
We wrote our own to work with SQL Server and C#
(it is proprietary, I can't share it)
Months later, we are still finding edge cases - there are many edge cases.
If you still want to write your own, you are probably mistaken..
If records can be created client side - use GUID identifiers
If it is an existing database with integer identifiers, add a GUID identifier field.
Set aside a few months of time to work out the rest.

Do I need MongoDB Atlas if I have Heroku?

Can someone explain me why we need the Atlas?
If I have Heroku which gives an easier access to cloud (PaaS), then why we need MongoDB Atlas?
Some sources say that we can connect Heroku with Atlas, but why we need that? And can please someone explain me the difference, because it seems I do not understand it completely.
Will be very thankful to everyone. Articles will also be good.
Heroku is a PAAS where you can deploy your applications. Multiple languages are supported and the development experience is great (deploy from Git or using Docker, plenty of examples and documentation).
Typically your application needs a data store to persist the data, Heroku offers few options (ie Postgres) but no more MongoDB. An alternative is to use Atlas where you can define your MongoDB cluster and databases.
Both Heroku and Atlas have a free-tier so you can run both the application and the database without cost. As your database grows you might need to buy a different subscription, this applies to Heroku too if you require more resources or for example no downtime (Heroku Free tier sends the Dyno to sleep after 30 min inactivity).
A good article to use Heroku with Atlas is Detaching from mLab

How i can share data which i connected with Heroku connect with other salesforce users

I have my website in PHP and DB in MySQL. I want salesforce users to search on my database from within their salesforce. For that, heroku connect seems to be the option. So i am thinking of converting my MySQL DB to PostGre and then use heroku connect to share my data with my salesforce account. The question i have is, how can i share same data with other salesforce users ? Those users are my website clients and i don't want them to go through this process of heroku connect. Is there was of sharing my data with other salesforce users ?
You cannot and should not expose your database directly to your customers. That would allow them to change the data as well as read it.
Your solution here is to create a public API which exposes endpoints that will make it possible for anyone (with proper authentication hopefully) to query your data.
There are many ways you can design an API, whether it's a REST or a GraphQL one. This is something which can absolutely be done in PHP though.

Migrating from parse.com

Say I have 10K users for my app and I want to switch to my own custom server for backend. I have seen the Parse export functionality but I don't get how it can help me in this situation.
I mean even if I export all data and make updates to app so that it makes calls to my new custom server, still, it will take months for all my users to use updated version of app(many users don't update immediately, my last update on fb was year ago).
Also, during this transition half of my users would be having their
data on my custom server and other half(those who haven't updated)
would be using parse server, so for queries that require all data in one place this becomes an issue (I could solve this via replication but imagine how slow it would be in realtime to push the data to both - my server and parse.com).
Has anyone thought about this ?
What you could do is when you release a new version of your app, when a user logs in and they are on parse, migrate their data at that point to the new server and from that point on that user uses the custom server. That way users move to the new server as they upgrade, I always have a flag that is fetched from my server to force the user to upgrade if is needed. Hope that helps.
Copying data over to your new backend periodically until you have finalize your mobile client code and then allow the user to update their app on the App Store or Google Play Store would provide the switch over. Doing that elegantly would be dependent on the type of app and user base you have for the app. I wrote up a part 1 of a blog on these considerations for migrating over from Parse to Couchbase Mobile stack and the reasons why to consider the stack.
If you can already attach a new system in place to have new data in two places (Parse and customer backend) then the copy and merge in the future might be easier to handle but this is case by case. Then when on mobile app update, you can depreciate the server. Or push data to have local store for those users who will be on older versions since Parse will eventually stop working. Any new experiences will require update to the new App version.

sharing data with heroku apps

Hi what is the recommended way of sharing data in heroku apps.
The reason why I ask is that I have a scheduler app which runs a process every 5 mins and places data in a memcache (memcachier).
I would then like another servlet based app to be able to read that same memcache data and return it to the user.
I tried to do this but the data is returning null.
Would it be better to use a database or is there any other way of doing this.
Can the memcache be shared across dynos?
Yup, all these things are connected as attachable resources via your config variables. It's perfectly OK to have many apps using the same attached resources.
http://www.12factor.net/backing-services
http://www.12factor.net/config

Resources