Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
PHP Microservices

You're reading from   PHP Microservices Transit from monolithic architectures to highly available, scalable, and fault-tolerant microservices

Arrow left icon
Product type Paperback
Published in Mar 2017
Publisher Packt
ISBN-13 9781787125377
Length 392 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Carlos Pérez Sánchez Carlos Pérez Sánchez
Author Profile Icon Carlos Pérez Sánchez
Carlos Pérez Sánchez
Pablo Solar Vilariño Pablo Solar Vilariño
Author Profile Icon Pablo Solar Vilariño
Pablo Solar Vilariño
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. What are Microservices? FREE CHAPTER 2. Development Environment 3. Application Design 4. Testing and Quality Control 5. Microservices Development 6. Monitoring 7. Security 8. Deployment 9. From Monolithic to Microservices 10. Strategies for Scalability 11. Best Practices and Conventions 12. Cloud and DevOps

Security of the source code


The most likely situation is that your project will connect to an external service using some credentials, for example, a database. Where will you store all this information? The most common way is to have a configuration file inside your source where you place all your credentials. The main problem with this approach is that you will commit the credentials, and any person with access to the source will have access to them. It doesn't matter that you trust the people who have access to the repo; it is not a good idea to store credentials.

If you can't store credentials in your source code, you are probably wondering how you will store them. You have two main options:

  • Environment variables

  • External services

Let's take a look at each one so that you can choose which option is better for your project.

Environment variables

This way of storing credentials is very easy to implement--you only define the variables you want to store in the environment and later, you can get...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image