sync client database data to master database - laravel - laravel

I'm building a multi-tenant saas application using laravel 5.7 and vuejs. Whatever new client register the system will create new database for him as well all table migrations and seeding will be done via events.
But when super admin manage the application, how to load each client data to super admin panel, or let's say super admin want to make a announcement to al of his client, how to handle this in laravel so announcement data get synced to all database.

Maybe create a separate DB for SUPER-ADMIN, and that DB will be contains clients_table and other data needed to read/write data in clients-DB (data like client db name, user, password, for establish connection to his db etc.).
Alternatively - you can create special table `clients_announcments' in super-admin-db (or may be new db: common_clients_db) and use it for that (and read it from clients) - depends of how many clients you have and what efficency you need
If you create so "big" saas system with many DB, I also encourage you to hard separation between backend and frontend - this means laravel backend will only provide Restful API (NO html-css-js code - only pure php), and frotend client will be separate vue/angular/react project which will consume that API. Key words "micro-service architecture", "restful api"

Related

Oracle ORDS SQL WEB setup to store app users data

I am new to development and learning through lot of youtube videos and oracle documentation. I have a question for which I was not able to find a solution online and was hoping someone could help answer it here..
I want to use oracle free tier cloud based autonomous transactional database and create the rest api on it using the below url as a reference.
https://oracle.github.io/learning-library/developer-library/rest-services-for-adb-appDevLive/workshops/freetier/?lab=secure-endpoints#Task1:SecuringtheRESTEndpoint
However my question is if I create a web app where I can get the user to create account using username and password, what is the best practice to store the data and retrive for auth in the oracle database for auth user.
Is there a credentials table where I can store all the username and password details or should I use a encypted table.
Also, Can someone please help advise how to create sql post method query to retrieve the user creds for validation.
Thank you for all your guidence.
Thank you!
In the database you have a schema - this is the collection of objects -
tables
views
stored procedures
rest apis
these are owned by a USER. A database user and schema in Oracle are largely synonymous and a user will have a password.
You then also have your application. Your application most likely also has users. These are completely different users than what you have in the database.
Now, your application COULD use database authentication, but that's highly not recommended. Why? Because then your application users could also theoretically go directly into the database.
It's not clear by your question if you're asking how to manage database usernames and passwords in general or if you mean in terms of your application.
For your application, we recommend you use either our OAuth2 workflows to secure your REST APIs, or you build your own authentication system...for example you could control access to your APIs in the Oracle Cloud using the API Gateway Service.
For managing passwords in the database, you should most definitely NOT store those in a table somewhere. THe user when they get their password, should securely manage that as they would the password to their online banking system.
The web interface we have would work just fine with online password managers like LastPass, but I'm not personally advocating or saying that would be good for your scenario.
Running SQL to find out someone's password isn't really what we do in Oracle. Either you already know it, or you change the password to something so that you definitely know it.

is it possible to authenticate in a springboot app using the different oracle accounts

I'm developing a web application and I'm wondering if i can set the authentication to check the oracle users instead of a user table I that I manually make.
Basically I want this to make it easier to trace user activities using oracle's native logs and add an extra layer to manage permissions.

Is there a way to create database and seed data in asp.net core 2 when changing the connection string

Is there a way to create the database and seed data in asp.net core 2 when changing the connection string through the OnConfiguring method of the DbContext?
I have designed my app for multi-tenancy (multi-database model) and should be able to register tenants dynamically each with connection string. Now my problem is, how can I create the database and seed data dynamically without restarting the app?
OnConfiguring screenshot
Basically the process of provisioning a database for a new tenant would require some time. Hence, you could follow the below steps.
Create a new tenant in the code
Post a message to the service bus with the necessary information like the tenanid / name etc.
Have a job ( typically the web Job) listen to the messages and run restore a new database from a master dacpac or script. Finally rename the database to the tenant.
Push back a message via service bus to let the application know about the database.
On receipt of the above message, the application updates the connection details for the tenant in the database.
In the other option, you can take a look at the Azure shard map for the tenant database sharding.
HTH

How to add user into database for BPM Suite

I configure store user into database (SQL Server) on bpm suite v6.4.0. How to insert user into database (don't insert by manual), i want know bpm suite v6.4.0 have library support for this doesn't. I don't find document mention this problem.
Thanks for any idea or your help
Authentication/authorization is delegated to an underlying security configuration. I assume you are configuring your security domain to retrieve login information from database? jBPM has some basic user and group mgmt UI (for creating users / groups etc.) that will push these changes to the underlying service. We do have an adapter for RH-SSO so I would recommend to configure your app server to delegate authentication/authorization to RH-SSO, which could be configured to use a database for storing users.

How to use Multitenant in Nhibernate with Spring in MVC

I have an application in MVC with Hnibernate deployed on a server. Currently only one client is using this application. Now there are many clients and all will use this app with different database but the schema will same for all.
For this implementation I am thinking an approach-
I have made a new database in which table hold the information regarding the individual Client database connection strings.
When the application run, Nhiberate makes multiple session factories for all database which includes all client databases and the main database.
For example- there are two clients 'A' and 'B' with their database name 'A_db' and 'B_db'. And the other main database which hold connection strings as 'All_db'. Then in this case nhibernate make 3 session factories for all three db.
So when user enter their login credential, i'll check the related connection string for that client from the main database. and then destroy all session factories which are not related to that client database connection string. So by doing this there will be only one session factory remain that belong to his database.
Is this my approach is correct??
And i am going in right direction then provide some code for this approach as making multiple session factories and after then removing all session factories except the related one?
You can supply a connectionstring to the GetSession method. Check out this link for more intel.

Resources